Go to file
Ming Lei 42ba3197a5 io_uring: move local task_work in exit cancel loop
commit da579f05ef0faada3559e7faddf761c75cdf85e1 upstream.

With IORING_SETUP_DEFER_TASKRUN, task work is queued to ctx->work_llist
(local work) rather than the fallback list. During io_ring_exit_work(),
io_move_task_work_from_local() was called once before the cancel loop,
moving work from work_llist to fallback_llist.

However, task work can be added to work_llist during the cancel loop
itself. There are two cases:

1) io_kill_timeouts() is called from io_uring_try_cancel_requests() to
cancel pending timeouts, and it adds task work via io_req_queue_tw_complete()
for each cancelled timeout:

2) URING_CMD requests like ublk can be completed via
io_uring_cmd_complete_in_task() from ublk_queue_rq() during canceling,
given ublk request queue is only quiesced when canceling the 1st uring_cmd.

Since io_allowed_defer_tw_run() returns false in io_ring_exit_work()
(kworker != submitter_task), io_run_local_work() is never invoked,
and the work_llist entries are never processed. This causes
io_uring_try_cancel_requests() to loop indefinitely, resulting in
100% CPU usage in kworker threads.

Fix this by moving io_move_task_work_from_local() inside the cancel
loop, ensuring any work on work_llist is moved to fallback before
each cancel attempt.

Cc: stable@vger.kernel.org
Fixes: c0e0d6ba25 ("io_uring: add IORING_SETUP_DEFER_TASKRUN")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-23 11:18:42 +01:00
arch x86/fpu: Clear XSTATE_BV[i] in guest XSAVE state whenever XFD[i]=1 2026-01-23 11:18:35 +01:00
block block: fix NULL pointer dereference in blk_zone_reset_all_bio_endio() 2026-01-08 10:15:06 +01:00
certs
crypto crypto: seqiv - Do not use req->iv after crypto_aead_encrypt 2026-01-08 10:14:32 +01:00
Documentation soundwire: stream: extend sdw_alloc_stream() to take 'type' parameter 2026-01-08 10:15:04 +01:00
drivers drm/amd/display: mark static functions noinline_for_stack 2026-01-23 11:18:42 +01:00
fs btrfs: fix memory leaks in create_space_info() error paths 2026-01-23 11:18:38 +01:00
include mm, kfence: describe @slab parameter in __kfence_obj_info() 2026-01-23 11:18:40 +01:00
init init: handle bootloader identifier in kernel parameters 2025-10-19 16:33:50 +02:00
io_uring io_uring: move local task_work in exit cancel loop 2026-01-23 11:18:42 +01:00
ipc
kernel sched/fair: Proportional newidle balance 2026-01-11 15:25:21 +01:00
lib lib/crypto: aes: Fix missing MMU protection for AES S-box 2026-01-17 16:31:16 +01:00
LICENSES
mm mm/page_alloc: change all pageblocks migrate type on coalescing 2026-01-11 15:25:20 +01:00
net bridge: mcast: Fix use-after-free during router port configuration 2026-01-23 11:18:42 +01:00
rust rust: kbuild: workaround rustdoc doctests modifier bug 2025-11-24 10:36:07 +01:00
samples samples/ftrace: Adjust LoongArch register restore order in direct calls 2026-01-08 10:14:50 +01:00
scripts kbuild: fix compilation of dtb specified on command-line without make rule 2026-01-08 10:14:34 +01:00
security tpm2-sessions: Fix out of range indexing in name_size 2026-01-17 16:31:29 +01:00
sound ASoC: codecs: wsa883x: fix unnecessary initialisation 2026-01-23 11:18:42 +01:00
tools selftests/landlock: Properly close a file descriptor 2026-01-23 11:18:41 +01:00
usr kbuild: uapi: Strip comments before size type check 2025-11-13 15:34:35 -05:00
virt KVM: Disallow toggling KVM_MEM_GUEST_MEMFD on an existing memslot 2026-01-08 10:14:21 +01:00
.clang-format
.clippy.toml rust: give Clippy the minimum supported Rust version 2025-08-01 09:48:44 +01:00
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS staging: rtl8712: Remove driver using deprecated API wext 2025-12-07 06:25:02 +09:00
Makefile Linux 6.12.66 2026-01-17 16:31:30 +01:00
README

Linux kernel

There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.

In order to build the documentation, use make htmldocs or make pdfdocs. The formatted documentation can also be read online at:

https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory, several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.