From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Cc: Kun Hu <[email protected]>
Subject: Re: [PATCH 1/1] io_uring/sqpoll: fix sqpoll error handling races
Date: Thu, 26 Dec 2024 10:01:29 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <0f2f1aa5729332612bd01fe0f2f385fd1f06ce7c.1735231717.git.asml.silence@gmail.com>
On 12/26/24 9:49 AM, Pavel Begunkov wrote:
> BUG: KASAN: slab-use-after-free in __lock_acquire+0x370b/0x4a10 kernel/locking/lockdep.c:5089
> Call Trace:
> <TASK>
> ...
> _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162
> class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline]
> try_to_wake_up+0xb5/0x23c0 kernel/sched/core.c:4205
> io_sq_thread_park+0xac/0xe0 io_uring/sqpoll.c:55
> io_sq_thread_finish+0x6b/0x310 io_uring/sqpoll.c:96
> io_sq_offload_create+0x162/0x11d0 io_uring/sqpoll.c:497
> io_uring_create io_uring/io_uring.c:3724 [inline]
> io_uring_setup+0x1728/0x3230 io_uring/io_uring.c:3806
> ...
>
> Kun Hu reports that the SQPOLL creating error path has UAF, which
> happens if io_uring_alloc_task_context() fails and then io_sq_thread()
> manages to run and complete before the rest of error handling code,
> which means io_sq_thread_finish() is looking at already killed task.
Might be worth mentioning that this is only really a fault injection
thing. But ouside of that, looks fine to me - thanks!
--
Jens Axboe
next prev parent reply other threads:[~2024-12-26 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 16:49 [PATCH 1/1] io_uring/sqpoll: fix sqpoll error handling races Pavel Begunkov
2024-12-26 17:01 ` Jens Axboe [this message]
2024-12-27 16:25 ` 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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