Files
linux/drivers
Robin Guo 17854c2e9b usb: musb: Fix musb_gadget.c rxstate overflow bug
[ Upstream commit eea4c860c3 ]

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>
2023-06-13 14:13:36 +09:00
..
2023-05-16 12:22:16 +09:00
2023-05-15 12:46:28 +09:00
2023-06-13 14:12:44 +09:00
2023-06-13 14:13:36 +09:00
2023-06-13 14:13:14 +09:00
2023-05-16 09:58:13 +09:00
2023-06-13 14:12:40 +09:00
2023-05-15 10:37:00 +09:00
2023-05-15 09:23:01 +09:00
2023-05-15 08:28:33 +09:00
2023-05-15 16:59:11 +09:00