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.
Published: 2026-05-01
Score: n/a
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The Linux kernel’s HID gadget driver contained an ordering problem in which wait‑queue heads and list structures were initialized during the bind phase while they still held queued items. When a user opened /dev/hidg0, registered the descriptor with EPOLL, caused the device controller to unbind and rebind, and then deleted the EPOLL entry, the driver re‑initialized these structures, corrupting kernel pointers. This kernel data‑structure corruption can trigger a list_del error and potentially allow a local user to execute code with elevated privileges.

Affected Systems

All Linux kernel releases that include the f_hid gadget driver and use the bind‑time initialization sequence are affected. The patch that moves initialization to the allocation stage is present in later kernel versions; therefore, any kernel before the commit that introduced this change is vulnerable. Exact version numbers are not provided in the CVE description.

Risk and Exploitability

The vulnerability is local; an attacker must have permission to open /dev/hidg0 on the affected system. No publicly available exploit code is known and the EPSS score is not reported, so the risk must be assessed manually. The flaw is a high‑severity kernel data‑corruption bug that could lead to privilege escalation. It is not listed in CISA’s KEV catalogue, and the remaining exploitation window depends on the attacker’s ability to drive the exact bind/unbind/epoll sequence.

Generated by OpenCVE AI on May 2, 2026 at 10:35 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that contains the f_hid initialization fix
  • Restrict access to /dev/hidg0 using udev rules or permission settings so that only trusted users can open the device
  • Monitor kernel logs for list_del errors or other indication of data‑structure corruption; if such errors occur, consider disabling the HID gadget or adjusting EPOLL usage

Generated by OpenCVE AI on May 2, 2026 at 10:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4561-1 linux-6.1 security update
Debian DSA Debian DSA DSA-6243-1 linux security update
History

Sat, 02 May 2026 00:15:00 +0000


Fri, 01 May 2026 14:45:00 +0000

Type Values Removed Values Added
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.
Title usb: gadget: f_hid: move list and spinlock inits from bind to alloc
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-02T06:14:22.498Z

Reserved: 2026-03-09T15:48:24.134Z

Link: CVE-2026-31721

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-01T15:16:34.490

Modified: 2026-05-01T15:24:14.893

Link: CVE-2026-31721

cve-icon Redhat

Severity :

Publid Date: 2026-05-01T00:00:00Z

Links: CVE-2026-31721 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-05-02T10:45:40Z

Weaknesses