CVE-2026-31606 usb: gadget: f_hid: don't call cdev_init while cdev in use
A use-after-free vulnerability in the Linux kernel USB HID gadget driver allows local attackers to cause a system crash by reopening the device during unbind/bind cycles.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-31606?
CVE-2026-31606 is a medium-severity use after free vulnerability in Linux kernel, published on 24 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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.
Which versions are affected by CVE-2026-31606?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2026-31606?
Apply the vendor's patch.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2026-31606 being exploited?
There is no known exploitation of CVE-2026-31606 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2026-31606, DEBIAN-CVE-2026-31606, GHSA-48xp-r2j8-cfx4, ROOT-OS-DEBIAN-11-CVE-2026-31606, ROOT-OS-DEBIAN-12-CVE-2026-31606, ROOT-OS-UBUNTU-2204-CVE-2026-31606 and 2 more.