# CVE-2026-31721: usb: gadget: f\_hid: move list and spinlock inits from bind to alloc

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 4, 2026-11-28)
- **Published:** 2026-05-01T14:14:23.492Z
- **Modified:** 2026-11-11T21:10:00.200Z

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

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

- Linux: \>= cb382536052fcc7713988869b54a81137069e5a9, \< 13440c0db227c5db01da751ed966dde4cdd2ea18; \>= cb382536052fcc7713988869b54a81137069e5a9, \< de93e0862169b5539e00c2b9980b93fd80c37c0d; \>= cb382536052fcc7713988869b54a81137069e5a9, \< 81aee4500055876883658b024b6fb61801afe134; \>= cb382536052fcc7713988869b54a81137069e5a9, \< 8ec6a58586f195a88479edcdb0b8027c39f12d03; \>= cb382536052fcc7713988869b54a81137069e5a9, \< f7d00ee1c8082c8a134340aaf16d71a27e29c362; \>= cb382536052fcc7713988869b54a81137069e5a9, \< 5d1bb391ceeebb28327703dd07af8c6324af298f; \>= cb382536052fcc7713988869b54a81137069e5a9, \< 26a879a41ed960b3fb4ec773ef2788c515c0e488; \>= cb382536052fcc7713988869b54a81137069e5a9, \< 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 (cvelist)
- Linux: 3.19 (cvelist)

## Mitigation

- Upgrade Linux to 4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.17% chance of exploitation in the next 30 days (as of 2026-11-28).

### 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.

## References

- patch: <https://git.kernel.org/stable/c/13440c0db227c5db01da751ed966dde4cdd2ea18>
- patch: <https://git.kernel.org/stable/c/de93e0862169b5539e00c2b9980b93fd80c37c0d>
- patch: <https://git.kernel.org/stable/c/81aee4500055876883658b024b6fb61801afe134>
- patch: <https://git.kernel.org/stable/c/8ec6a58586f195a88479edcdb0b8027c39f12d03>
- patch: <https://git.kernel.org/stable/c/f7d00ee1c8082c8a134340aaf16d71a27e29c362>
- patch: <https://git.kernel.org/stable/c/5d1bb391ceeebb28327703dd07af8c6324af298f>
- patch: <https://git.kernel.org/stable/c/26a879a41ed960b3fb4ec773ef2788c515c0e488>
- patch: <https://git.kernel.org/stable/c/4e0a88254ad59f6c53a34bf5fa241884ec09e8b2>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-31721>

HTML: <https://flawdb.com/CVE-2026-31721> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-31721>
