linux_dsm_epyc7002/drivers/usb/gadget/udc
Alan Stern 54f83b8c8e USB: gadget: Reject endpoints with 0 maxpacket value
Endpoints with a maxpacket length of 0 are probably useless.  They
can't transfer any data, and it's not at all unlikely that a UDC will
crash or hang when trying to handle a non-zero-length usb_request for
such an endpoint.  Indeed, dummy-hcd gets a divide error when trying
to calculate the remainder of a transfer length by the maxpacket
value, as discovered by the syzbot fuzzer.

Currently the gadget core does not check for endpoints having a
maxpacket value of 0.  This patch adds a check to usb_ep_enable(),
preventing such endpoints from being used.

As far as I know, none of the gadget drivers in the kernel tries to
create an endpoint with maxpacket = 0, but until now there has been
nothing to prevent userspace programs under gadgetfs or configfs from
doing it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: syzbot+8ab8bf161038a8768553@syzkaller.appspotmail.com
CC: <stable@vger.kernel.org>
Acked-by: Felipe Balbi <balbi@kernel.org>

Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.1910281052370.1485-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-29 09:56:18 +01:00
..
aspeed-vhub
bdc
amd5536udc_pci.c
amd5536udc.h
at91_udc.c
at91_udc.h
atmel_usba_udc.c usb: gadget: udc: atmel: Fix interrupt storm in FIFO mode. 2019-10-27 08:58:45 +02:00
atmel_usba_udc.h
bcm63xx_udc.c
core.c USB: gadget: Reject endpoints with 0 maxpacket value 2019-10-29 09:56:18 +01:00
dummy_hcd.c
fotg210-udc.c
fotg210.h
fsl_mxc_udc.c
fsl_qe_udc.c
fsl_qe_udc.h
fsl_udc_core.c usb: fsl: Check memory resource before releasing it 2019-10-27 08:58:44 +02:00
fsl_usb2_udc.h
fusb300_udc.c
fusb300_udc.h
goku_udc.c
goku_udc.h
gr_udc.c
gr_udc.h
Kconfig
lpc32xx_udc.c usb: udc: lpc32xx: fix bad bit shift operation 2019-10-15 20:07:44 +02:00
m66592-udc.c
m66592-udc.h
Makefile
mv_u3d_core.c
mv_u3d.h
mv_udc_core.c
mv_udc.h
net2272.c
net2272.h
net2280.c
net2280.h
omap_udc.c
omap_udc.h
pch_udc.c
pxa25x_udc.c
pxa25x_udc.h
pxa27x_udc.c
pxa27x_udc.h
r8a66597-udc.c
r8a66597-udc.h
renesas_usb3.c usb: gadget: udc: renesas_usb3: Fix __le16 warnings 2019-10-27 08:58:44 +02:00
s3c2410_udc.c
s3c2410_udc.h
s3c-hsudc.c
snps_udc_core.c
snps_udc_plat.c
trace.c
trace.h
udc-xilinx.c