]> git.itanic.dy.fi Git - linux-stable/commit
io_uring/fdinfo: lock SQ thread while retrieving thread cpu/pid
authorJens Axboe <axboe@kernel.dk>
Sat, 21 Oct 2023 18:30:29 +0000 (12:30 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 25 Oct 2023 13:44:14 +0000 (07:44 -0600)
commit7644b1a1c9a7ae8ab99175989bfc8676055edb46
treedfa13e49521a00400a40c955f9f927a2e41c9af4
parent8b51a3956d44ea6ade962874ade14de9a7d16556
io_uring/fdinfo: lock SQ thread while retrieving thread cpu/pid

We could race with SQ thread exit, and if we do, we'll hit a NULL pointer
dereference when the thread is cleared. Grab the SQPOLL data lock before
attempting to get the task cpu and pid for fdinfo, this ensures we have a
stable view of it.

Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=218032
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/fdinfo.c