CVE-2026-31721
usb: gadget: f_hid: move list and spinlock inits from bind to alloc
Mitigation
- Upgrade Linux to 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 or later.
Who should check
- Anyone running Linux >= cb382536052fcc7713988869b54a81137069e5a9, < 13440c0db227c5db01da751ed966dde4cdd2ea18; >= cb382536052fcc7713988869b54a81137069e5a9, < de93e0862169b5539e00c2b9980b93fd80c37c0d; >= cb382536052fcc7713988869b54a81137069e5a9, < 81aee4500055876883658b024b6fb61801afe134; >= cb382536052fcc7713988869b54a81137069e5a9, < 8ec6a58586f195a88479edcdb0b8027c39f12d03; >= cb382536052fcc7713988869b54a81137069e5a9, < f7d00ee1c8082c8a134340aaf16d71a27e29c362; >= cb382536052fcc7713988869b54a81137069e5a9, < 5d1bb391ceeebb28327703dd07af8c6324af298f; >= cb382536052fcc7713988869b54a81137069e5a9, < 26a879a41ed960b3fb4ec773ef2788c515c0e488; >= cb382536052fcc7713988869b54a81137069e5a9, < 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2
- Anyone running Linux 3.19
Vulnerability facts
- Affected
- Linux >= cb382536052fcc7713988869b54a81137069e5a9, < 13440c0db227c5db01da751ed966dde4cdd2ea18; >= cb382536052fcc7713988869b54a81137069e5a9, < de93e0862169b5539e00c2b9980b93fd80c37c0d; >= cb382536052fcc7713988869b54a81137069e5a9, < 81aee4500055876883658b024b6fb61801afe134; >= cb382536052fcc7713988869b54a81137069e5a9, < 8ec6a58586f195a88479edcdb0b8027c39f12d03; >= cb382536052fcc7713988869b54a81137069e5a9, < f7d00ee1c8082c8a134340aaf16d71a27e29c362; >= cb382536052fcc7713988869b54a81137069e5a9, < 5d1bb391ceeebb28327703dd07af8c6324af298f; >= cb382536052fcc7713988869b54a81137069e5a9, < 26a879a41ed960b3fb4ec773ef2788c515c0e488; >= cb382536052fcc7713988869b54a81137069e5a9, < 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2; Linux 3.19
- Fixed in
- Linux 13440c0db227c5db01da751ed966dde4cdd2ea18, Linux 81aee4500055876883658b024b6fb61801afe134, Linux 8ec6a58586f195a88479edcdb0b8027c39f12d03, Linux 5d1bb391ceeebb28327703dd07af8c6324af298f, Linux 26a879a41ed960b3fb4ec773ef2788c515c0e488, Linux 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 5.5 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 0.16% chance of exploitation in 30 days (percentile 3, 2026-11-26)
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_hid: move list and spinlock inits from bind to alloc There was an issue when you did the following: - setup and bind an hid gadget - open /dev/hidg0 - use the resulting fd in EPOLL_CTL_ADD - unbind the UDC - bind the UDC - use the fd in EPOLL_CTL_DEL When CONFIG_DEBUG_LIST was enabled, a list_del corruption was reported within remove_wait_queue (via ep_remove_wait_queue). After some debugging I found out that the queues, which f_hid registers via poll_wait were the problem. These were initialized using init_waitqueue_head inside hidg_bind. So effectively, the bind function re-initialized the queues while there were still items in them. The solution is to move the initialization from hidg_bind to hidg_alloc to extend their lifetimes to the lifetime of the function instance. Additionally, I found many other possibly problematic init calls in the bind function, which I moved as well.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= cb382536052fcc7713988869b54a81137069e5a9, < 13440c0db227c5db01da751ed966dde4cdd2ea18; >= cb382536052fcc7713988869b54a81137069e5a9, < de93e0862169b5539e00c2b9980b93fd80c37c0d; >= cb382536052fcc7713988869b54a81137069e5a9, < 81aee4500055876883658b024b6fb61801afe134; >= cb382536052fcc7713988869b54a81137069e5a9, < 8ec6a58586f195a88479edcdb0b8027c39f12d03; >= cb382536052fcc7713988869b54a81137069e5a9, < f7d00ee1c8082c8a134340aaf16d71a27e29c362; >= cb382536052fcc7713988869b54a81137069e5a9, < 5d1bb391ceeebb28327703dd07af8c6324af298f; >= cb382536052fcc7713988869b54a81137069e5a9, < 26a879a41ed960b3fb4ec773ef2788c515c0e488; >= cb382536052fcc7713988869b54a81137069e5a9, < 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 | — | cvelist |
| Linux | 3.19 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-31721. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-31721.md Affected: Linux >= cb382536052fcc7713988869b54a81137069e5a9, < 13440c0db227c5db01da751ed966dde4cdd2ea18; >= cb382536052fcc7713988869b54a81137069e5a9, < de93e0862169b5539e00c2b9980b93fd80c37c0d; >= cb382536052fcc7713988869b54a81137069e5a9, < 81aee4500055876883658b024b6fb61801afe134; >= cb382536052fcc771398886… Fixed in: Linux 13440c0db227c5db01da751ed966dde4cdd2ea18, Linux 81aee4500055876883658b024b6fb61801afe134, Linux 8ec6a58586f195a88479edcdb0b8027c39f12d03, Linux 5d1bb391ceeebb28327703dd07af8c6324af298f, Linux 26a879a41ed960b3fb4ec773ef2788c515c0e488, Linux 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Patches
- https://git.kernel.org/stable/c/13440c0db227c5db01da751ed966dde4cdd2ea18
- https://git.kernel.org/stable/c/de93e0862169b5539e00c2b9980b93fd80c37c0d
- https://git.kernel.org/stable/c/81aee4500055876883658b024b6fb61801afe134
- https://git.kernel.org/stable/c/8ec6a58586f195a88479edcdb0b8027c39f12d03
- https://git.kernel.org/stable/c/f7d00ee1c8082c8a134340aaf16d71a27e29c362
- https://git.kernel.org/stable/c/5d1bb391ceeebb28327703dd07af8c6324af298f
- https://git.kernel.org/stable/c/26a879a41ed960b3fb4ec773ef2788c515c0e488
- https://git.kernel.org/stable/c/4e0a88254ad59f6c53a34bf5fa241884ec09e8b2
FAQ
Is CVE-2026-31721 being exploited?
There is no confirmed exploitation: CVE-2026-31721 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.16% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-31721?
Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2026-31721?
Linux >= cb382536052fcc7713988869b54a81137069e5a9, < 13440c0db227c5db01da751ed966dde4cdd2ea18; >= cb382536052fcc7713988869b54a81137069e5a9, < de93e0862169b5539e00c2b9980b93fd80c37c0d; >= cb382536052fcc7713988869b54a81137069e5a9, < 81aee4500055876883658b024b6fb61801afe134; >= cb382536052fcc7713988869b54a81137069e5a9, < 8ec6a58586f195a88479edcdb0b8027c39f12d03; >= cb382536052fcc7713988869b54a81137069e5a9, < f7d00ee1c8082c8a134340aaf16d71a27e29c362; >= cb382536052fcc7713988869b54a81137069e5a9, < 5d1bb391ceeebb28327703dd07af8c6324af298f; >= cb382536052fcc7713988869b54a81137069e5a9, < 26a879a41ed960b3fb4ec773ef2788c515c0e488; >= cb382536052fcc7713988869b54a81137069e5a9, < 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2; Linux 3.19.
Is there a fix for CVE-2026-31721?
Yes. Fixed in Linux 13440c0db227c5db01da751ed966dde4cdd2ea18, Linux 81aee4500055876883658b024b6fb61801afe134, Linux 8ec6a58586f195a88479edcdb0b8027c39f12d03, Linux 5d1bb391ceeebb28327703dd07af8c6324af298f, Linux 26a879a41ed960b3fb4ec773ef2788c515c0e488, Linux 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2. Upgrade Linux to 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 or later.
How do I check if I'm affected by CVE-2026-31721?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.