io_uring/io-wq: re-check IO_WQ_BIT_EXIT for each linked work item
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ bdf0bf73006ea8af9327cdb85cfdff4c23a5f966 · < 1636d85dc139b07c0449308f2bb5e0c7a2e0da99| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
io_uring/io-wq: re-check IO_WQ_BIT_EXIT for each linked work item
commit 10dc95939817 ("io_uring/io-wq: check IO_WQ_BIT_EXIT inside work run loop") fixed the obvious case where io_worker_handle_work() took one exit-bit snapshot before draining pending work, but the fix stops one level too early.
io_worker_handle_work() now re-checks IO_WQ_BIT_EXIT in its outer work run loop, yet it still snapshots that bit once before processing a whole dependent linked-work chain. If io_wq_exit_start() sets IO_WQ_BIT_EXIT after the first linked item has started, the remaining linked items can still reuse stale do_kill = false, skip IO_WQ_WORK_CANCEL, and continue running after exit has begun.
Move the check further inside, so it covers linked items too. Note: this is a syzbot special as it loves setting up tons of slow linked work on weird devices like msr that take forever to read, and immediately close the ring. Exit then takes a long time.
From the CVE record · Linux
The Linux kernel's io_uring/io-wq worker can continue running linked work after ring exit begins because it does not re-check the exit bit for each linked item. This can make exit take a long time when slow linked work is queued and the ring is closed. The input does not specify an attack path, authentication requirement, or user-interaction requirement.
Teams running Linux kernels with io_uring/io-wq should check their kernel's vendor advisory; affected versions are not specified.