]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't take files/mm for a dead task
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 11 Jan 2021 04:00:31 +0000 (04:00 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 11 Jan 2021 14:39:54 +0000 (07:39 -0700)
commita960455b61f3209655d4c680df9d18562f409af5
tree94756a0e03f262cce362d1d165660fb5c01990a4
parent7ee222210ea878b48740275f4abcd0729bb3fe84
io_uring: don't take files/mm for a dead task

In rare cases a task may be exiting while io_ring_exit_work() trying to
cancel/wait its requests. It's ok for __io_sq_thread_acquire_mm()
because of SQPOLL check, but is not for __io_sq_thread_acquire_files().
Play safe and fail for both of them.

Cc: stable@vger.kernel.org # 5.5+
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c