CVE-2026-31721
kernel: usb: gadget: f_hid: move list and spinlock inits from bind to alloc
Overview
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.
Source: OX vulnerability database
Severity
5.5 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Affected packages · 0
No registry package. This ID affects operating system packages only.
Operating systems · 73 fixes
Photon OS 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | bpftool +9 | 5.10.253-1.ph4 |
| 5.0 | bpftool +10 | 6.1.169-1.ph5 |
SUSE Linux Enterprise 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 16.0 | cluster-md-kmp-default +26 | 6.12.0-160000.37.1 | SUSE-SU-2026:23221-1 |
| 16.0 | kernel-default-base | 6.12.0-160000.37.1.160000.2.19 | SUSE-SU-2026:23221-1 |
SUSE Linux Enterprise Micro 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 6.2 | kernel-64kb +11 | 6.12.0-160000.37.1 | SUSE-SU-2026:23068-1 |
| 6.2 | kernel-default-base | 6.12.0-160000.37.1.160000.2.19 | SUSE-SU-2026:23068-1 |
debian 4 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux | 5.10.257-1 |
| 11 | linux-6-1 | 6.1.170-1~deb11u1 |
| 12 | linux | 6.1.170-1 |
| 13 | linux | 6.12.85-1 |
| 14 | linux | 6.19.12-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| linux | 1 |
openSUSE Leap 1 release · 2 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 16.0 | cluster-md-kmp-64kb +74 | 6.12.0-160000.37.1 | openSUSE-SU-2026:21555-1 |
| 16.0 | kernel-default-base | 6.12.0-160000.37.1.160000.2.19 | openSUSE-SU-2026:21555-1 |
root.io debian 3 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux +1 | 5.10.251-5.root.io.85 |
| 12 | rootio-linux | 6.1.170-1 |
| 13 | rootio-linux | 6.12.85-1 |
root.io ubuntu 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 22.04 | linux +1 | 5.15.0-179.189.root.io.88 |
| 24.04 | linux +1 | 6.8.0-117.117.root.io.67 |
ubuntu 4 releases · 41 packages
| Release | Package | Fixed in |
|---|---|---|
| 20.04-ESM | linux-nvidia-tegra-5-15 | 5.15.0-1064.66~20.04.1 |
| 20.04-ESM | linux-ibm-5-15 +1 | 5.15.0-1106.110~20.04.1 |
| 20.04-ESM | linux-intel-iotg-5-15 | 5.15.0-1107.113~20.04.1 |
| 20.04-ESM | linux-oracle-5-15 | 5.15.0-1109.115~20.04.1 |
| 20.04-ESM | linux-aws-5-15 | 5.15.0-1112.119~20.04.1 |
| 20.04-ESM | linux-gcp-5-15 | 5.15.0-1112.122~20.04.1 |
48 more rows
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2026-31721
- git.kernel.org https://git.kernel.org/linus/4e0a88254ad59f6c53a34bf5fa241884ec09e8b2 (7.0-rc7)
- git.kernel.org https://git.kernel.org/stable/c/13440c0db227c5db01da751ed966dde4cdd2ea18
- git.kernel.org https://git.kernel.org/stable/c/26a879a41ed960b3fb4ec773ef2788c515c0e488
- git.kernel.org https://git.kernel.org/stable/c/4e0a88254ad59f6c53a34bf5fa241884ec09e8b2
- git.kernel.org https://git.kernel.org/stable/c/5d1bb391ceeebb28327703dd07af8c6324af298f
- git.kernel.org https://git.kernel.org/stable/c/81aee4500055876883658b024b6fb61801afe134
- git.kernel.org https://git.kernel.org/stable/c/8ec6a58586f195a88479edcdb0b8027c39f12d03
- git.kernel.org https://git.kernel.org/stable/c/de93e0862169b5539e00c2b9980b93fd80c37c0d
- git.kernel.org https://git.kernel.org/stable/c/f7d00ee1c8082c8a134340aaf16d71a27e29c362
Show all 40 references
- lore.kernel.org https://lore.kernel.org/linux-cve-announce/2026050133-CVE-2026-31721-3c17@gregkh/T
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2026-31721
- ubuntu.com https://ubuntu.com/security/notices/USN-8567-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8574-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8574-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8574-3
- ubuntu.com https://ubuntu.com/security/notices/USN-8575-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8575-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8575-3
- ubuntu.com https://ubuntu.com/security/notices/USN-8576-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8576-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8595-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8595-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8595-3
- ubuntu.com https://ubuntu.com/security/notices/USN-8596-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8597-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8606-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8607-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8608-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8609-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8610-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8619-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8620-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8620-2
- ubuntu.com https://ubuntu.com/security/notices/USN-8620-3
- ubuntu.com https://ubuntu.com/security/notices/USN-8620-4
- ubuntu.com https://ubuntu.com/security/notices/USN-8665-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8668-1
- ubuntu.com https://ubuntu.com/security/notices/USN-8668-2
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2026-31721
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.