CVE-2026-31606

usb: gadget: f_hid: don't call cdev_init while cdev in use

Published Apr 24, 2026 CVSS 3.1 · 5.5 Medium EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

usb: gadget: f_hid: don't call cdev_init while cdev in use

When calling unbind, then bind again, cdev_init reinitialized the cdev,
even though there may still be references to it. That's the case when
the /dev/hidg* device is still opened. This obviously unsafe behavior
like oopes.

This fixes this by using cdev_alloc to put the cdev on the heap. That
way, we can simply allocate a new one in hidg_bind.

Analysis

AI-generated

Technical impact

A bug in the Linux kernel’s USB gadget HID driver causes the character device (cdev) to be reinitialized while it is still in use. The buggy code invokes cdev_init again on an existing cdev that may still have open references, leading to memory corruption and an 'oops' kernel crash. This vulnerability can result in denial-of-service by crashing the system. The weakness is a classic Resource Management error (CWE-413).

Affected Systems

All Linux kernel builds that include the f_hid gadget driver without the patch. The affected code is part of the usb: gadget subsystem; specific kernel versions are not enumerated in the provided data, so any kernel that has shipped the unpatched f_hid module may be vulnerable.

Risk and Exploitability

The EPSS score of less than 1% indicates a very low likelihood of exploitation in the wild, and the vulnerability is not listed in the CISA KEV catalog. The CVSS score of 5.5 reflects medium severity. Exploitation would likely require local access to a system that hosts a USB gadget using the f_hid driver and would exploit the reinitialization bug to corrupt kernel memory, potentially crashing the system. The attack vector is local, based on manipulating the bind/unbind sequence of the HID gadget device.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Check the installed kernel version and compare it against known patched releases that move from cdev_init to cdev_alloc in hidg_bind.
  • If an affected kernel is in use, apply the patch that allocates the cdev on the heap, preventing reuse of an active device.
  • Verify that the USB gadget HID driver is disabled or updated on systems that do not require HID functionality to reduce exposure.

Generated by OpenCVE AI on April 30, 2026 at 04:07 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4906-1 linux security update
Debian DSA Debian DSA DSA-6238-1 linux security update
Ubuntu USN Ubuntu USN USN-8488-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8488-2 Linux kernel (Raspberry Pi) vulnerabilities
Ubuntu USN Ubuntu USN USN-8507-1 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8567-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8569-1 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-8574-1 Linux kernel (GCP FIPS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8574-2 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8595-1 Linux kernel (Oracle) vulnerabilities
Ubuntu USN Ubuntu USN USN-8596-1 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8595-2 Linux kernel (AWS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8603-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-8606-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-8607-1 Linux kernel (Azure CVM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8608-1 Linux kernel (Azure FIPS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8609-1 Linux kernel (Azure CVM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8574-3 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8595-3 Linux kernel (AWS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8619-1 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-8665-1 Linux kernel (Raspberry Pi) vulnerabilities
History
Type Values Removed Values Added
Weaknesses NVD-CWE-noinfo
Metrics cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_hid: don't call cdev_init while cdev in use When calling unbind, then bind again, cdev_init reinitialized the cdev, even though there may still be references to it. That's the case when the /dev/hidg* device is still opened. This obviously unsafe behavior like oopes. This fixes this by using cdev_alloc to put the cdev on the heap. That way, we can simply allocate a new one in hidg_bind.
Title usb: gadget: f_hid: don't call cdev_init while cdev in use
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 30, 2026, 12:24 PM
Reserved
Mar 9, 2026, 3:48 PM
Status
Modified
Published
Apr 24, 2026, 3:16 PM
Modified
Nov 11, 2026, 11:10 PM
Severity
Public date
Apr 24, 2026, 12:00 AM