# CVE-2022-50876: usb: musb: Fix musb_gadget.c rxstate overflow bug

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2025-12-30T12:23:16.790Z
- Modified: 2026-06-17T05:24:20.200Z
- Assigned by: Linux

## 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);

(As written by CVE List.)

## Affected

- Linux Linux: from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before 826f84ab04a5cafe484ea9c2c85a3930068e5cb7; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before a1008c8b9f357691ce6a8fdb8f157aecb2d79167; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before 7c80f3a918ba9aa26fb699ee887064ec3af0396a; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before d6afcab1b48f4051211c50145b9e91be3b1b42c9; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before acf0006f2b2b2ca672988875fd154429aafb2a9b; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before 3c84c7f592c4ba38f54ddaddd0115acc443025db; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before a9ccd2ab1becf5dcb6d57e9fcd981f5eaa606c96; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before 523313881f0aa5cbbdb548ce575b6e58b202bd76; from 03840fad004ce8a56bc8b3bb60a2df10f6f9481e before eea4c860c3b366369eff0489d94ee4f0571d467d; 4.3 (not affected: before 4.3; from 4.9.331 up to 4.9.*; from 4.14.296 up to 4.14.*; from 4.19.262 up to 4.19.*; from 5.4.220 up to 5.4.*; from 5.10.150 up to 5.10.*; from 5.15.75 up to 5.15.*; from 5.19.17 up to 5.19.*; from 6.0.3 up to 6.0.*; from 6.1 up to *)

## References

- <https://git.kernel.org/stable/c/826f84ab04a5cafe484ea9c2c85a3930068e5cb7>
- <https://git.kernel.org/stable/c/a1008c8b9f357691ce6a8fdb8f157aecb2d79167>
- <https://git.kernel.org/stable/c/7c80f3a918ba9aa26fb699ee887064ec3af0396a>
- <https://git.kernel.org/stable/c/d6afcab1b48f4051211c50145b9e91be3b1b42c9>
- <https://git.kernel.org/stable/c/acf0006f2b2b2ca672988875fd154429aafb2a9b>
- <https://git.kernel.org/stable/c/3c84c7f592c4ba38f54ddaddd0115acc443025db>
- <https://git.kernel.org/stable/c/a9ccd2ab1becf5dcb6d57e9fcd981f5eaa606c96>
- <https://git.kernel.org/stable/c/523313881f0aa5cbbdb548ce575b6e58b202bd76>
- <https://git.kernel.org/stable/c/eea4c860c3b366369eff0489d94ee4f0571d467d>

## Sources

- CVE List: [CVE-2022-50876](https://www.cve.org/CVERecord?id=CVE-2022-50876), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-50876](https://nvd.nist.gov/vuln/detail/CVE-2022-50876), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-50876 · Whole record: https://cve.day/CVE-2022-50876.json · Rebuilt by cve.day 2026-11-25T22:58:21.388Z
