Linux kernel denial of service in io_uring worker shutdown
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ afcc4015d1bf5659b8c722aff679e9b8c41ee156 · < 7df9a3b5eda51c512d3dd138e3b7daa525071757| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
io_uring/io-wq: don't lose the signal that ends work
When a thread exits, only its tracked requests are cancelled. Then its io-wq is torn down. io_wq_exit_workers() signals every worker, to get it out of an interruptible sleep, and waits for all of them to exit. Before they do, they go through the work that is left. Unbounded work is cancelled. Bounded work is run, as it is expected to end by itself.
Not all of it does. An open has no file yet, so it counts as bounded, and the open of a FIFO waits for the other end. That is what the signal is for. But the workers are signalled once, and a worker that hasn't started the work by then loses the signal:
io_wq_exit_workers() io_worker_handle_work() io_wq_worker_wake() set TIF_NOTIFY_SIGNAL io_assign_current_work() io_run_task_work() clear TIF_NOTIFY_SIGNAL io_wq_submit_work() fifo_open() wait_for_partner() wait_for_completion_timeout()
The thread never gets out of do_exit():
IORING_OP_OPENAT of a FIFO without a writer, IOSQE_ASYNC exit of the thread that has submitted it
hangs in more than 9 of 10 attempts (4 CPUs, KVM), until the process is killed.
From the CVE record · Linux
Linux kernel io_uring/io-wq workers can lose a signal needed to stop work during thread exit. A thread that submits an asynchronous open of a FIFO without a writer can then hang while exiting, until the process is killed. The described trigger is local; the input does not specify authentication requirements.
Engineers running Linux kernels with the affected io_uring/io-wq code should check their kernel version; affected versions are not specified.