CVE-2026-143235: ublk: publish a new device by its id only once it is set up
In the Linux kernel, the following vulnerability has been resolved:
ublk: publish a new device by its id only once it is set up
ADDDEV stores the device in ublkindexidr when it allocates the id, and control commands find it there as soon as ublkaddchdev() has initialized its struct device, before the char device is added. If devsetname() or cdevdeviceadd() then fails, ublkaddchdev() drops the initial reference to free the device. A DELDEV that found the device meanwhile waits for ublkctlmutex, then calls ublkremove(): cdevdevicedel() of a device that was never added, and a second put of the initial reference, which frees the device under the callers still holding references.
Reserve the id with a NULL entry, which idrfind() and the idr iterators skip, and store the device once ublkaddchdev() succeeded.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7
Event History
Frequently Asked Questions
What conditions are required to trigger the issue?
A new ublk device must be visible to control commands while its character-device setup is still in progress, and dev_set_name() or cdev_device_add() must then fail. A concurrent DEL_DEV can find that partially initialized device and remove it.
What is the consequence of the concurrent removal?
The removal path can call cdev_device_del() for a device that was never added and drop the initial reference a second time. This can free the device while other callers still hold references to it.