Re: [PATCH] io_uring: Don't set affinity on a dying sqpoll thread

From: Jens Axboe
Date: Tue Aug 29 2023 - 13:38:31 EST



On Mon, 28 Aug 2023 19:42:49 -0400, Gabriel Krisman Bertazi wrote:
> Syzbot reported a null-ptr-deref of sqd->thread inside
> io_sqpoll_wq_cpu_affinity. It turns out the sqd->thread can go away
> from under us during io_uring_register, in case the process gets a
> fatal signal during io_uring_register.
>
> It is not particularly hard to hit the race, and while I am not sure
> this is the exact case hit by syzbot, it solves it. Finally, checking
> ->thread is enough to close the race because we locked sqd while
> "parking" the thread, thus preventing it from going away.
>
> [...]

Applied, thanks!

[1/1] io_uring: Don't set affinity on a dying sqpoll thread
commit: 37b1499057f61de370dbd8f0c296274ab7186605

Best regards,
--
Jens Axboe