VYPR
Unrated severityNVD Advisory· Published Dec 30, 2025· Updated Apr 15, 2026

CVE-2022-50876

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

1

Patches

9

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

9

News mentions

0

No linked articles in our index yet.