]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: prevent racy sqd->thread checks
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 11 Mar 2021 23:29:37 +0000 (23:29 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Mar 2021 16:42:53 +0000 (09:42 -0700)
commit6e7b0b322977471ed61a409edf35782ba7451ac4
tree2b70bcfbf5b5f9605ff37c55ff938d98a44edc35
parent27845553dfdefe1e3b36f616aeac1ebeb75004f5
io_uring: prevent racy sqd->thread checks

SQPOLL thread to which we're trying to attach may be going away, it's
not nice but a more serious problem is if io_sq_offload_create() sees
sqd->thread==NULL, and tries to init it with a new thread. There are
tons of ways it can be exploited or fail.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c