usb: musb: Fix musb_gadget.c rxstate overflow bug
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 03840fad004ce8a56bc8b3bb60a2df10f6f9481e · < 3c84c7f592c4ba38f54ddaddd0115acc443025db| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: musb: Fix musb_gadget.c rxstate overflow bug
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);
From the CVE record · Linux
The Linux kernel’s USB MUSB gadget receive path can copy FIFO data beyond a request buffer. This can occur when a queued request is larger than the endpoint packet size and its buffer is not mapped. The input does not specify attacker access, authentication, or user-interaction requirements.
Engineers running Linux kernels with the USB MUSB gadget driver should check their versions; affected versions are not specified.