CVE-2026-99797: io_uring/cancel: drop sqd->lock while SQPOLL waits
In the Linux kernel, the following vulnerability has been resolved:
iouring/cancel: drop sqd->lock while SQPOLL waits
An exiting SQPOLL thread calls iouringcancelgeneric() with sqd->lock held, and keeps it across condresched() and the sleep until nothing is in flight anymore. A zero-copy send notification can't be canceled and stays pending as long as the peer doesn't read, so the lock is held for as long as a user cares to. ioringexitwork() needs it to park the thread, and so do IORINGREGISTERIOWQAFF and IOWQMAXWORKERS. With 64 such rings sharing the thread, every iouexit slot sleeps on the lock and no ring gets freed for anyone.
Drop the lock around condresched() and the sleep, like the main loop of the thread does. Each walk of ctxlist is still under one hold, and nothing is kept across the unlock. The thread drops its io-wq, frees its tctx and clears sqd->thread under one hold after the loop, so whoever holds the lock and finds sqd->thread set can still use them.
[axboe: adapted to the scheduletimeout() based loop]
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.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1 - Compensating control
In io_uring cancellation, drop sqd->lock around cond_resched() and the sleep while SQPOLL waits; keep each ctx_list walk under one lock hold, and clear sqd->thread under one hold after the loop.
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using Linux io_uring with SQPOLL threads are affected by the described lock contention condition. The impact is particularly relevant when many rings share an SQPOLL thread.
What conditions can trigger the lock being held for an extended time?
An SQPOLL thread must be exiting while a zero-copy send notification remains pending because its peer is not reading. Since that notification cannot be canceled, the exit path can wait while holding sqd->lock.
What operational impact can this cause?
Operations that need sqd->lock, including parking the thread during ring exit and the IORING_REGISTER_IOWQ_AFF and IOWQ_MAX_WORKERS registration paths, can block. With 64 rings sharing the thread, all available iou_exit slots can sleep on the lock and prevent rings from being freed.
What is the remediation described by the fix?
The fix releases sqd->lock around cond_resched() and the wait loop, while retaining the lock for each individual ctx_list walk. This prevents the lock from remaining held while waiting for in-flight work to finish.