Commit d434ab6
io_uring: drop mm and files after task_work_run
__io_req_task_submit() run by task_work can set mm and files, but
io_sq_thread() in some cases, and because __io_sq_thread_acquire_mm()
and __io_sq_thread_acquire_files() do a simple current->mm/files check
it may end up submitting IO with mm/files of another task.
We also need to drop it after in the end to drop potentially grabbed
references to them.
Cc: stable@vger.kernel.org # 5.9+
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent d9d0521 commit d434ab6
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7056 | 7056 | | |
7057 | 7057 | | |
7058 | 7058 | | |
| 7059 | + | |
7059 | 7060 | | |
7060 | 7061 | | |
7061 | 7062 | | |
| |||
7093 | 7094 | | |
7094 | 7095 | | |
7095 | 7096 | | |
| 7097 | + | |
7096 | 7098 | | |
7097 | 7099 | | |
7098 | 7100 | | |
| |||
0 commit comments