VYPR
Medium severity5.5NVD Advisory· Published Apr 24, 2026· Updated Apr 29, 2026

CVE-2026-31606

CVE-2026-31606

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Linux kernel USB gadget f_hid driver could crash (oops) when rebinding after unbind while the device file is still open.

Vulnerability

In the Linux kernel's USB gadget f_hid driver, a use-after-free-like condition occurs when the driver is unbound and then rebound while the corresponding /dev/hidg* character device is still open. The cdev_init function is called during bind, which reinitializes the cdev structure even though existing references (e.g., from an open file descriptor) may still be using it. This unsafe behavior can lead to a kernel oops [1].

Exploitation

An attacker with local access and the ability to trigger a USB gadget unbind/bind cycle (e.g., by manipulating the gadget configuration via configfs or sysfs) can exploit this flaw. The attack requires that the /dev/hidg* device is already opened by a process, which could be a legitimate user or a malicious actor. No special privileges beyond the ability to reconfigure the USB gadget are needed, though the attacker must have access to the gadget's control interface.

Impact

Successful exploitation results in a kernel oops, causing a denial of service (system crash or hang). The CVSS v3 score of 5.5 (Medium) reflects the local attack vector and the requirement for the device to be open, but the impact is limited to availability. There is no evidence of privilege escalation or data leakage from the available sources.

Mitigation

The fix, committed as [1] and backported to stable kernels [2][3][4], replaces the use of cdev_init with cdev_alloc, which allocates a new cdev on the heap during each bind. This ensures that the old cdev remains valid until all references are released. Users should apply the latest kernel updates from their distribution or compile a patched kernel.

AI Insight generated on May 18, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

1
  • cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
    Range: >=3.19,<6.12.83

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.