CVE-2022-50876 usb: musb: Fix musb_gadget.c rxstate overflow bug
A buffer overflow in the Linux kernel MUSB USB gadget driver allows attackers with physical access to cause memory corruption or system crashes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-50876?
CVE-2022-50876 is a memory corruption vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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);
Which versions are affected by CVE-2022-50876?
How do I fix CVE-2022-50876?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2022-50876 being exploited?
There is no known exploitation of CVE-2022-50876 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2022-50876, GHSA-6h2f-jvv5-3x53, UBUNTU-CVE-2022-50876.