1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 16:06:04 -05:00
linux/io_uring
Pavel Begunkov dbd2ca9367 io_uring: check if iowq is killed before queuing
task work can be executed after the task has gone through io_uring
termination, whether it's the final task_work run or the fallback path.
In this case, task work will find ->io_wq being already killed and
null'ed, which is a problem if it then tries to forward the request to
io_queue_iowq(). Make io_queue_iowq() fail requests in this case.

Note that it also checks PF_KTHREAD, because the user can first close
a DEFER_TASKRUN ring and shortly after kill the task, in which case
->iowq check would race.

Cc: stable@vger.kernel.org
Fixes: 50c52250e2 ("block: implement async io_uring discard cmd")
Fixes: 773af69121 ("io_uring: always reissue from task_work context")
Reported-by: Will <willsroot@protonmail.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/63312b4a2c2bb67ad67b857d17a300e1d3b078e8.1734637909.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-12-19 13:31:53 -07:00
..
advise.c
advise.h
alloc_cache.h
cancel.c
cancel.h
epoll.c
epoll.h
eventfd.c
eventfd.h
fdinfo.c
fdinfo.h
filetable.c
filetable.h
fs.c
fs.h
futex.c
futex.h
io-wq.c
io-wq.h
io_uring.c io_uring: check if iowq is killed before queuing 2024-12-19 13:31:53 -07:00
io_uring.h io_uring: limit local tw done 2024-11-21 07:11:00 -07:00
kbuf.c
kbuf.h
Makefile
memmap.c io_uring: fix corner case forgetting to vunmap 2024-11-27 15:00:57 -07:00
memmap.h
msg_ring.c
msg_ring.h
napi.c
napi.h
net.c
net.h
nop.c io_uring/nop: ensure nop->fd is always initialized 2024-11-21 07:15:30 -07:00
nop.h
notif.c
notif.h
opdef.c
opdef.h
openclose.c
openclose.h
poll.c
poll.h
refs.h
register.c io_uring/register: limit ring resizing to DEFER_TASKRUN 2024-12-19 09:32:26 -07:00
register.h
rsrc.c io_uring/rsrc: don't put/free empty buffers 2024-12-12 08:01:52 -07:00
rsrc.h
rw.c A rather large update for timekeeping and timers: 2024-11-19 16:35:06 -08:00
rw.h
slist.h
splice.c
splice.h
sqpoll.c for-6.13/io_uring-20241118 2024-11-18 17:02:57 -08:00
sqpoll.h
statx.c
statx.h
sync.c
sync.h
tctx.c io_uring/tctx: work around xa_store() allocation error issue 2024-11-29 07:20:28 -07:00
tctx.h
timeout.c io_uring: make ctx->timeout_lock a raw spinlock 2024-12-17 08:21:46 -07:00
timeout.h
truncate.c
truncate.h
uring_cmd.c io_uring: Change res2 parameter type in io_uring_cmd_done 2024-12-03 06:33:13 -07:00
uring_cmd.h
waitid.c
waitid.h
xattr.c
xattr.h