From: Jens Axboe <axboe@kernel.dk>
To: stable@vger.kernel.org
Subject: [PATCH 6.6.y 00/19] io_uring fixes for 6.6-stable
Date: Sat, 21 Nov 2026 21:30:30 +0000 [thread overview]
Message-ID: <20261121213049.1788332-1-axboe@kernel.dk> (raw)
Hi Greg,
Here are io_uring fixes for 6.6-stable. All 19 patches are in Linus's
tree. Patches 2-5 came with the io_uring-7.4 pull, merged as commit
78d9aedf2342 (tag io_uring-7.4-20261119); the others were merged
earlier.
They apply on top of v6.6.162 plus queue-6.6 at stable-queue commit
3dd4b2d3c1f7. They do not apply to v6.6.162 alone: patches 1-7 do, but
8/19 depends on the queued io_uring sqpoll patches.
Patches 1-8, 11, 15 and 18 needed changes for 6.6; the [axboe: ...] note
at the end of each says what was changed and why. The rest are clean
backports.
Please take patches 6-19 together: they are the SQPOLL private task_work
handling from 6.9 (8/19, with 6/19 and 7/19 as prep) and the fixes that
followed it upstream, whose Fixes: tags name it. Patches 1-5 are
independent of that group.
Patch 1/19 (io_uring: enable toggle of iowait usage when waiting on
CQEs) is a feature, not a fix. It is in stable because the QEMU
developers asked for it: QEMU uses IORING_ENTER_NO_IOWAIT and wants it
supported on all current stable kernels. Nothing changes unless the flag
is set.
Testing: ran the liburing-2.15-75-ga10946dc test suite in KVM guests
(PROVE_LOCKING on) on the baseline v6.6.162 kernel and on the patched
kernel, which is v6.6.162 plus these patches and the other io_uring
commits already queued. The patched kernel failed the same tests as the
baseline, except connect-backlog, which failed only on the baseline (a
flaky test). The failures that remain are on both kernels (napi-test
timeout, send-zerocopy, timestamp and similar). No new dmesg splat
(WARNING, BUG, lockdep, KASAN, Oops). io_uring/ builds without warnings
on the release plus queue plus patches.
CVE assessment, by the io_uring maintainer:
Should not get a CVE:
1/19 io_uring: enable toggle of iowait usage when waiting on CQEs
Feature, not a fix. IORING_ENTER_NO_IOWAIT only skips setting
in_iowait; nothing changes unless the flag is set.
2/19 io_uring: fail soft links on negative IOU_COMPLETE results
io_issue_sqe() now calls req_set_fail() for negative IOU_COMPLETE
results, so IOSQE_IO_LINK dependents of a failed request are
cancelled. This only changes link semantics of the caller's own
requests.
3/19 io_uring/rw: fail soft links on IOPOLL short or error IO
The IOPOLL completion path now calls req_set_fail() when the
result changed, so linked requests are cancelled after a short or
failed read/write. Only the caller's own link chain is affected.
4/19 io_uring/timeout: don't rearm a multishot timeout on cancel
A cancelled multishot timeout was re-armed from the cancel task
work. A zero interval plus moving the CQ head far ahead only
delays teardown of the caller's own ring; the loop goes through
hrtimer and workqueue, so it reschedules and holds no spinlock.
5/19 io_uring/rsrc: keep the old file when a file update fails
The old file was dropped from the registered slot before the new
fd was checked, so a failed update left the slot empty and posted
its tag CQE. Only the caller's own file table, no refcount or
lifetime problem.
6/19 io_uring: cleanup handle_tw_list() calling convention
prep for 8/19 (handle_tw_list() calling convention).
7/19 io_uring: pass in counter to handle_tw_list() rather than return
it
prep for 8/19 (handle_tw_list() counter).
8/19 io_uring/sqpoll: manage task_work privately
Rework, not a fix: SQPOLL runs its own task_work list. Prep for
the follow-up fixes 9-19, which are fixes for this patch.
9/19 io_uring: wake SQPOLL task when task_work is added to an empty
queue
Fixes a stall introduced by 8/19; 6.6 releases don't have it.
Missed wakeup.
10/19 io_uring/sqpoll: use the correct check for pending task_work
Fixes 8/19: wrong pending check, a stall. Not present in any 6.6
release.
11/19 io_uring/sqpoll: early exit thread if task_context wasn't
allocated
Fixes 8/19 (a missing tctx early exit). Part of the same rework,
no 6.6 release has the bug.
12/19 io_uring/sqpoll: ensure that normal task_work is also run timely
Fixes 8/19: normal task_work not run timely, a latency bug.
13/19 io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI
Fixes 8/19: signal method for SQPOLL task_work, a latency bug.
14/19 io_uring/sqpoll: ensure task state is TASK_RUNNING when running
task_work
Fixes a might_sleep WARN that 8/19 introduces; the old 6.6 code
ran task_work through io_run_task_work() and never had it. Not in
any 6.6 release.
15/19 io_uring: don't touch sqd->thread off tw add
Fixes 9/19: a theoretical sqd->thread reload, the author says
unlikely.
16/19 io_uring/sqpoll: zero sqd->thread on tctx errors
KASAN UAF in fdinfo, but only with fault injection and only on the
early exit added by 11/19; no 6.6 release has it.
17/19 io_uring/sqpoll: Increase task_work submission batch size
Batch size tuning for 8/19, performance.
18/19 io_uring: fix task_work add use-after-free with SQPOLL MIME-
Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-
Transfer-Encoding: 8bit
KASAN UAF in the task_work add, but only through the private
SQPOLL list added by 8/19; no 6.6 release has it.
19/19 io_uring/sqpoll: do the return-to-userspace work in the SQPOLL
thread
Fixes 8/19: memory.high reclaim not done in the SQPOLL thread,
accounting/throttling only.
Cheng Yongkang (2):
io_uring/timeout: don't rearm a multishot timeout on cancel
io_uring/rsrc: keep the old file when a file update fails
Gabriel Krisman Bertazi (1):
io_uring/sqpoll: Increase task_work submission batch size
Jens Axboe (11):
io_uring: enable toggle of iowait usage when waiting on CQEs
io_uring: cleanup handle_tw_list() calling convention
io_uring: pass in counter to handle_tw_list() rather than return it
io_uring/sqpoll: manage task_work privately
io_uring: wake SQPOLL task when task_work is added to an empty queue
io_uring/sqpoll: use the correct check for pending task_work
io_uring/sqpoll: early exit thread if task_context wasn't allocated
io_uring/sqpoll: ensure that normal task_work is also run timely
io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI
io_uring/sqpoll: ensure task state is TASK_RUNNING when running
task_work
io_uring: fix task_work add use-after-free with SQPOLL
Pavel Begunkov (2):
io_uring: don't touch sqd->thread off tw add
io_uring/sqpoll: zero sqd->thread on tctx errors
Shakeel Butt (1):
io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread
Yang Xiuwei (2):
io_uring: fail soft links on negative IOU_COMPLETE results
io_uring/rw: fail soft links on IOPOLL short or error IO
include/uapi/linux/io_uring.h | 2 +
io_uring/io_uring.c | 104 ++++++++++++++++++++++------------
io_uring/io_uring.h | 25 ++++++--
io_uring/rsrc.c | 25 ++++----
io_uring/rw.c | 1 +
io_uring/sqpoll.c | 62 +++++++++++++++++++-
io_uring/timeout.c | 8 ++-
7 files changed, 168 insertions(+), 59 deletions(-)
--
2.55.0
next reply other threads:[~2026-11-21 21:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 21:30 Jens Axboe [this message]
2026-11-21 21:30 ` [PATCH 6.6.y 01/19] io_uring: enable toggle of iowait usage when waiting on CQEs Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 02/19] io_uring: fail soft links on negative IOU_COMPLETE results Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 03/19] io_uring/rw: fail soft links on IOPOLL short or error IO Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 04/19] io_uring/timeout: don't rearm a multishot timeout on cancel Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 05/19] io_uring/rsrc: keep the old file when a file update fails Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 06/19] io_uring: cleanup handle_tw_list() calling convention Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 07/19] io_uring: pass in counter to handle_tw_list() rather than return it Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 08/19] io_uring/sqpoll: manage task_work privately Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 09/19] io_uring: wake SQPOLL task when task_work is added to an empty queue Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 10/19] io_uring/sqpoll: use the correct check for pending task_work Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 11/19] io_uring/sqpoll: early exit thread if task_context wasn't allocated Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 12/19] io_uring/sqpoll: ensure that normal task_work is also run timely Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 13/19] io_uring: signal SQPOLL task_work with TWA_SIGNAL_NO_IPI Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 14/19] io_uring/sqpoll: ensure task state is TASK_RUNNING when running task_work Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 15/19] io_uring: don't touch sqd->thread off tw add Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 16/19] io_uring/sqpoll: zero sqd->thread on tctx errors Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 17/19] io_uring/sqpoll: Increase task_work submission batch size Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 18/19] io_uring: fix task_work add use-after-free with SQPOLL Jens Axboe
2026-11-21 21:30 ` [PATCH 6.6.y 19/19] io_uring/sqpoll: do the return-to-userspace work in the SQPOLL thread Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261121213049.1788332-1-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox