OrangePi_CM5/drivers/usb/musb
Robin Guo acf0006f2b usb: musb: Fix musb_gadget.c rxstate overflow bug
[ Upstream commit eea4c860c3b366369eff0489d94ee4f0571d467d ]

The usb function device call musb_gadget_queue() adds the passed
request to musb_ep::req_list,If the (request->length > musb_ep->packet_sz)
and (is_buffer_mapped(req) return false),the rxstate() will copy all data
in fifo to request->buf which may cause request->buf out of bounds.

Fix it by add the length check :
fifocnt = min_t(unsigned, request->length - request->actual, fifocnt);

Signed-off-by: Robin Guo <guoweibin@inspur.com>
Link: https://lore.kernel.org/r/20220906102119.1b071d07a8391ff115e6d1ef@inspur.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-26 13:25:53 +02:00
..
Kconfig
…
Makefile
…
am35x.c
…
cppi_dma.c
…
cppi_dma.h
…
da8xx.c
…
davinci.c
…
davinci.h
…
jz4740.c
…
mediatek.c
…
musb_core.c
…
musb_core.h
…
musb_cppi41.c
…
musb_debug.h
…
musb_debugfs.c
…
musb_dma.h
…
musb_dsps.c
…
musb_gadget.c
…
musb_gadget.h
…
musb_gadget_ep0.c
…
musb_host.c
…
musb_host.h
…
musb_io.h
…
musb_regs.h
…
musb_trace.c
…
musb_trace.h
…
musb_virthub.c
…
musbhsdma.c
…
omap2430.c
…
omap2430.h
…
sunxi.c
…
tusb6010.c
…
tusb6010.h
…
tusb6010_omap.c
…
ux500.c
…
ux500_dma.c
…