CVE-2022-50876
Description
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);
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel's USB musb gadget, a missing length check in rxstate() can cause a buffer overflow when request->length exceeds musb_ep->packet_sz.
Root
Cause
The vulnerability resides in the musb_gadget.c file of the Linux kernel's USB MUSB (Multi-function USB Peripheral Controller) driver. When musb_gadget_queue() adds a USB request to musb_ep::req_list, if request->length > musb_ep->packet_sz and is_buffer_mapped(req) returns false, the rxstate() function copies all data from the FIFO into request->buf without checking that the buffer can hold the incoming data [1][2][3]. This results in an out-of-bounds write on request->buf.
Exploitation
An attacker with physical USB access or the ability to send crafted USB control/transfer requests to a device using the affected MUSB driver can trigger this flaw. No special privileges are required beyond the ability to interact with the USB peripheral interface, making the attack surface accessible to unauthenticated users in proximity.
Impact
Successful exploitation leads to a buffer overflow, which can corrupt kernel memory. This may cause a system crash (denial of service) or, under specific conditions, allow an attacker to execute arbitrary code in the kernel context, compromising the entire system.
Mitigation
The fix adds a length check: fifocnt = min_t(unsigned, request->length - request->actual, fifocnt), ensuring that no more data is copied than the remaining buffer space allows [1][2][3]. Users should apply the stable kernel updates containing this commit.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
9826f84ab04a5a1008c8b9f357c80f3a918bad6afcab1b48facf0006f2b2b3c84c7f592c4a9ccd2ab1bec523313881f0aeea4c860c3b3Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- git.kernel.org/stable/c/3c84c7f592c4ba38f54ddaddd0115acc443025dbnvd
- git.kernel.org/stable/c/523313881f0aa5cbbdb548ce575b6e58b202bd76nvd
- git.kernel.org/stable/c/7c80f3a918ba9aa26fb699ee887064ec3af0396anvd
- git.kernel.org/stable/c/826f84ab04a5cafe484ea9c2c85a3930068e5cb7nvd
- git.kernel.org/stable/c/a1008c8b9f357691ce6a8fdb8f157aecb2d79167nvd
- git.kernel.org/stable/c/a9ccd2ab1becf5dcb6d57e9fcd981f5eaa606c96nvd
- git.kernel.org/stable/c/acf0006f2b2b2ca672988875fd154429aafb2a9bnvd
- git.kernel.org/stable/c/d6afcab1b48f4051211c50145b9e91be3b1b42c9nvd
- git.kernel.org/stable/c/eea4c860c3b366369eff0489d94ee4f0571d467dnvd
News mentions
0No linked articles in our index yet.