CVE-2026-100054: ublk: mark the batch fetch command cancelable before linking it
In the Linux kernel, the following vulnerability has been resolved:
ublk: mark the batch fetch command cancelable before linking it
UBLKUIOFETCHIOCMDS has the same order problem as the per-io commands: ublkbatchattach() links the fetch command into fcmdhead and marks it cancelable only after dropping evtslock. A cancel from the control path (ublkbatchcancelqueue()) can take it in between and complete it, and the later mark puts a completed request on iouring's cancelable list.
Mark it before linking it. evtslock orders the mark before the link, which is where the cancel finds it.
Batch commands are not bounced to task work, so they can run from io-wq without uringlock, and iouring's cancel walk can now find a fetch command before it is linked. Two things make that safe:
- initialize fcmd->node: it came from kzalloc(), so listempty() saw a linked node and ublkbatchcancelcmd() would listdelinit() NULL pointers - on the -ENODEV path, complete the command with iouringcmddone() before freeing fcmd: that removes it from the cancelable list under uringlock, after which nothing can see fcmd
Also use data->cmd instead of fcmd->cmd after dropping evtslock: once fcmd is linked and not the active one, a control-path cancel may complete and free it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Compensating control
In the ublk batch-fetch path, mark the fetch command cancelable before linking it; initialize fcmd->node, complete the command with io_uring_cmd_done() on the -ENODEV path, and use data->cmd instead of fcmd->cmd after dropping evts_lock.
Event History
Frequently Asked Questions
Which deployments are exposed to the race?
The affected path is UBLK batch I/O fetch handling using UBLK_U_IO_FETCH_IO_CMDS. The race requires the control path to cancel a queue while a batch fetch command is being attached.
What timing causes the unsafe state?
Previously, the fetch command was linked into fcmd_head before it was marked cancelable, after evts_lock was dropped. A concurrent ublk_batch_cancel_queue() could complete the command in that interval, after which the later cancelable mark could place an already completed request on io_uring's cancelable list.
What does the fix change to prevent the race?
The command is marked cancelable before it is linked, with evts_lock ordering the mark before the link that cancellation can discover. The fix also initializes the command list node and completes the command through io_uring_cmd_done() before freeing it on the -ENODEV path, removing it from the cancelable list first.