linux_dsm_epyc7002/drivers/usb/gadget/udc
Alan Stern e7f2c25aa8 USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug
commit c318840fb2a42ce25febc95c4c19357acf1ae5ca upstream.

The dummy-hcd driver was written under the assumption that all the
parameters in URBs sent to its root hub would be valid.  With URBs
sent from userspace via usbfs, that assumption can be violated.

In particular, the driver doesn't fully check the port-feature values
stored in the wValue entry of Clear-Port-Feature and Set-Port-Feature
requests.  Values that are too large can cause the driver to perform
an invalid left shift of more than 32 bits.  Ironically, two of those
left shifts are unnecessary, because they implement Set-Port-Feature
requests that hubs are not required to support, according to section
11.24.2.13 of the USB-2.0 spec.

This patch adds the appropriate checks for the port feature selector
values and removes the unnecessary feature settings.  It also rejects
requests to set the TEST feature or to set or clear the INDICATOR and
C_OVERCURRENT features, as none of these are relevant to dummy-hcd's
root-hub emulation.

CC: <stable@vger.kernel.org>
Reported-and-tested-by: syzbot+5925509f78293baa7331@syzkaller.appspotmail.com
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20201230162044.GA727759@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-12 20:18:20 +01:00
..
aspeed-vhub usb: gadget: aspeed: fixup vhub port irq handling 2020-10-02 09:43:36 +03:00
bdc usb: bdc: remove duplicated error message 2020-10-02 09:57:46 +03:00
amd5536udc_pci.c usb: gadget: Replace HTTP links with HTTPS ones 2020-07-15 16:33:52 +02:00
amd5536udc.h usb: gadget: Replace HTTP links with HTTPS ones 2020-07-15 16:33:52 +02:00
at91_udc.c usb: gadget: at91_udc: remove useless cast for driver.name 2020-02-19 11:10:25 +01:00
at91_udc.h
atmel_usba_udc.c usb: gadget: udc: atmel: update endpoint allocation for sam9x60 2020-09-24 11:56:17 +03:00
atmel_usba_udc.h usb: gadget: udc: atmel: update endpoint allocation for sam9x60 2020-09-24 11:56:17 +03:00
bcm63xx_udc.c usb: gadget: bcm63xx_udc: fix up the error of undeclared usb_debug_root 2020-10-02 09:57:43 +03:00
core.c usb: gadget: core: do not try to disconnect gadget if it is not connected 2020-10-02 09:57:43 +03:00
dummy_hcd.c USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug 2021-01-12 20:18:20 +01:00
fotg210-udc.c usb: gadget: fotg210-udc: remove useless cast for driver.name 2020-02-19 11:10:25 +01:00
fotg210.h
fsl_mxc_udc.c
fsl_qe_udc.c usb/gadget: fsl_qe_udc: convert tasklets to use new tasklet_setup() API 2020-08-18 13:00:01 +02:00
fsl_qe_udc.h usb: Spelling s/enpoint/endpoint/ 2019-11-04 15:53:00 +01:00
fsl_udc_core.c usb: gadget: fsl: fix null pointer checking 2020-10-27 10:57:24 +02:00
fsl_usb2_udc.h
fusb300_udc.c usb: gadget: fusb300_udc: remove useless cast for driver.name 2020-02-19 11:10:25 +01:00
fusb300_udc.h
goku_udc.c usb: gadget: goku_udc: fix potential crashes in probe 2020-10-27 10:55:45 +02:00
goku_udc.h
gr_udc.c Linux 5.8-rc6 2020-07-20 09:41:30 +02:00
gr_udc.h usb: gadget: Replace HTTP links with HTTPS ones 2020-07-15 16:33:52 +02:00
Kconfig USB: Fix up terminology 2020-07-01 14:04:04 +02:00
lpc32xx_udc.c usb: gadget: lpc32xx_udc: Convert to DEFINE_SHOW_ATTRIBUTE 2020-10-02 09:57:39 +03:00
m66592-udc.c usb: gadget: fix potential double-free in m66592_probe. 2020-05-25 11:09:43 +03:00
m66592-udc.h
Makefile usb: gadget: add udc driver for max3420 2020-03-15 11:06:39 +02:00
max3420_udc.c usb: gadget: Replace HTTP links with HTTPS ones 2020-07-15 16:33:52 +02:00
mv_u3d_core.c usb: gadget: udc: mv_u3d_core: Remove unused static const 'driver_desc' 2020-07-09 17:19:58 +02:00
mv_u3d.h usb: Spelling s/enpoint/endpoint/ 2019-11-04 15:53:00 +01:00
mv_udc_core.c usb: gadget: udc: mv_udc_core: Remove unused static const variable 'driver_desc' 2020-07-09 17:19:57 +02:00
mv_udc.h
net2272.c USB: UDC: net2272: Fix memory leaks 2020-10-02 09:57:42 +03:00
net2272.h USB: UDC: net2272: Fix memory leaks 2020-10-02 09:57:42 +03:00
net2280.c USB: changes for v5.10 merge window 2020-10-03 15:59:57 +02:00
net2280.h USB: UDC: net2280: Fix memory leaks 2020-10-02 09:57:42 +03:00
omap_udc.c usb: gadget: Use fallthrough pseudo-keyword 2020-07-10 08:55:18 +02:00
omap_udc.h
pch_udc.c usb: gadget: pch_udc: Convert to use GPIO descriptors 2020-10-02 09:57:38 +03:00
pxa25x_udc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
pxa25x_udc.h
pxa27x_udc.c usb: gadget: udc: pxa27x_udc: Fix a bunch of kerneldoc issues 2020-07-09 17:19:56 +02:00
pxa27x_udc.h
r8a66597-udc.c usb: gadget: r8a66597: convert to devm_platform_ioremap_resource_byname 2020-07-29 16:49:38 +02:00
r8a66597-udc.h
renesas_usb3.c usb: roles: Provide the switch drivers handle to the switch in the API 2020-03-04 11:12:50 +01:00
s3c2410_udc_regs.h usb: gadget: s3c: use platform resources 2020-08-19 20:58:22 +02:00
s3c2410_udc.c usb: gadget: s3c: Remove unused 'udc' variable 2020-10-02 09:57:43 +03:00
s3c2410_udc.h usb: gadget: s3c: use platform resources 2020-08-19 20:58:22 +02:00
s3c-hsudc.c usb: gadget: s3c-hsudc: remove platform header dependency 2020-08-19 20:58:27 +02:00
snps_udc_core.c USB/Thunderbolt patches for 5.9-rc1 2020-08-05 12:13:10 -07:00
snps_udc_plat.c
tegra-xudc.c usb: gadget: tegra-xudc: Do not print errors on probe deferral 2020-10-02 09:57:43 +03:00
trace.c
trace.h
udc-xilinx.c USB: ch9: add "USB_" prefix in front of TEST defines 2020-06-24 15:01:24 +02:00