linux_dsm_epyc7002/drivers/usb/gadget/legacy
Alan Stern 1c069b057d USB: gadgetfs: fix checks of wTotalLength in config descriptors
Andrey Konovalov's fuzz testing of gadgetfs showed that we should
improve the driver's checks for valid configuration descriptors passed
in by the user.  In particular, the driver needs to verify that the
wTotalLength value in the descriptor is not too short (smaller
than USB_DT_CONFIG_SIZE).  And the check for whether wTotalLength is
too large has to be changed, because the driver assumes there is
always enough room remaining in the buffer to hold a device descriptor
(at least USB_DT_DEVICE_SIZE bytes).

This patch adds the additional check and fixes the existing check.  It
may do a little more than strictly necessary, but one extra check
won't hurt.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Andrey Konovalov <andreyknvl@google.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-01-02 10:55:28 +02:00
..
acm_ms.c usb: f_mass_storage: test whether thread is running before starting another 2016-04-19 11:11:56 +03:00
audio.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
cdc2.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
dbgp.c usb: gadget: legacy: dbgp: eliminate abuse of ep->driver data 2015-09-27 10:54:31 -05:00
ether.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
g_ffs.c usb: gadget: fix unused-but-set-variale warnings 2016-06-21 11:04:09 +03:00
gmidi.c usb: gadget: f_midi: defaults buflen sizes to 512 2016-08-25 12:13:15 +03:00
hid.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
inode.c USB: gadgetfs: fix checks of wTotalLength in config descriptors 2017-01-02 10:55:28 +02:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2016-03-17 21:38:27 -07:00
Makefile usb: gadget: webcam: convert webcam to new interface of f_uvc 2014-09-09 09:49:31 -05:00
mass_storage.c usb: f_mass_storage: test whether thread is running before starting another 2016-04-19 11:11:56 +03:00
multi.c usb: f_mass_storage: test whether thread is running before starting another 2016-04-19 11:11:56 +03:00
ncm.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
nokia.c usb: f_mass_storage: test whether thread is running before starting another 2016-04-19 11:11:56 +03:00
printer.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
serial.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
tcm_usb_gadget.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
webcam.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00
zero.c usb: gadget: composite: remove redundant bcdUSB setting in legacy 2015-12-15 09:12:41 -06:00