linux-yocto/drivers/rapidio
Andrew Morton 50695153d7 drivers/rapidio/rio_cm.c: prevent possible heap overwrite
In

riocm_cdev_ioctl(RIO_CM_CHAN_SEND)
   -> cm_chan_msg_send()
      -> riocm_ch_send()

cm_chan_msg_send() checks that userspace didn't send too much data but
riocm_ch_send() failed to check that userspace sent sufficient data.  The
result is that riocm_ch_send() can write to fields in the rio_ch_chan_hdr
which were outside the bounds of the space which cm_chan_msg_send()
allocated.

Address this by teaching riocm_ch_send() to check that the entire
rio_ch_chan_hdr was copied in from userspace.

Reported-by: maher azz <maherazz04@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Linus Torvalds <torvalds@linuxfoundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-06-11 22:42:36 -07:00
..
devices rapidio: remove some dead defines 2025-05-11 17:54:09 -07:00
switches
Kconfig
Makefile
rio_cm.c drivers/rapidio/rio_cm.c: prevent possible heap overwrite 2025-06-11 22:42:36 -07:00
rio-access.c
rio-driver.c
rio-scan.c rapidio: add check for rio_add_net() in rio_scan_alloc_net() 2025-03-05 21:36:19 -08:00
rio-sysfs.c rapidio: constify 'struct bin_attribute' 2025-02-21 09:20:32 +01:00
rio.c rapidio: remove unused functions 2025-05-11 17:54:09 -07:00
rio.h rapidio: remove unused functions 2025-05-11 17:54:09 -07:00