Commit 14447cfe authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Zheng Zengkai
Browse files

io_uring: don't take files/mm for a dead task



stable inclusion
from stable-5.10.9
commit a3647cddfee6f5368028ec61b6232d0e7283b652
bugzilla: 47457

--------------------------------

[ Upstream commit 621fadc2 ]

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: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 795a4225
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment