kernel-hacking-2024-linux-s.../drivers/usb/class
Guus Sliepen 665d7662d1 USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbs
According to the specifications, an instrument should not return more data in a
DEV_DEP_MSG_IN urb than requested.  However, some instruments can send more
than requested. This could cause the kernel to write the extra data past the
end of the buffer provided by read().

Fix this by checking that the value of the TranserSize field is not larger than
the urb itself and not larger than the size of the userspace buffer. Also
correctly decrement the remaining size of the buffer when userspace read()s
more than USBTMC_SIZE_IOBUFFER.

Signed-off-by: Guus Sliepen <guus@sliepen.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-23 06:46:30 -07:00
..
cdc-acm.c USB: fix cdc-acm regression in open 2009-09-23 06:46:16 -07:00
cdc-acm.h USB: fix oops on disconnect in cdc-acm 2009-08-07 16:05:14 -07:00
cdc-wdm.c USB: CDC WDM driver doesn't support non-blocking reads 2009-09-23 06:46:16 -07:00
Kconfig
Makefile
usblp.c Driver-Core: extend devnode callbacks to provide permissions 2009-09-19 12:50:38 -07:00
usbtmc.c USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbs 2009-09-23 06:46:30 -07:00