linux-stable/io_uring
Jens Axboe 5a7d940632 io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL
[ Upstream commit 46a525e199 ]

This isn't a reliable mechanism to tell if we have task_work pending, we
really should be looking at whether we have any items queued. This is
problematic if forward progress is gated on running said task_work. One
such example is reading from a pipe, where the write side has been closed
right before the read is started. The fput() of the file queues TWA_RESUME
task_work, and we need that task_work to be run before ->release() is
called for the pipe. If ->release() isn't called, then the read will sit
forever waiting on data that will never arise.

Fix this by io_run_task_work() so it checks if we have task_work pending
rather than rely on TIF_NOTIFY_SIGNAL for that. The latter obviously
doesn't work for task_work that is queued without TWA_SIGNAL.

Reported-by: Christiano Haesbaert <haesbaert@haesbaert.org>
Cc: stable@vger.kernel.org
Link: https://github.com/axboe/liburing/issues/665
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-29 10:08:35 +02:00
..
Makefile
advise.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
advise.h
alloc_cache.h
cancel.c io_uring: fix off-by-one in sync cancelation file check 2022-08-23 07:26:08 -06:00
cancel.h
epoll.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
epoll.h
fdinfo.c io_uring: fix fdinfo sqe offsets calculation 2022-10-21 12:39:29 +02:00
fdinfo.h
filetable.c
filetable.h
fs.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
fs.h
io-wq.c io-wq: Fix memory leak in worker creation 2022-10-26 12:22:57 +02:00
io-wq.h
io_uring.c io_uring: fix CQE reordering 2022-10-21 12:39:24 +02:00
io_uring.h io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL 2022-10-29 10:08:35 +02:00
kbuf.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
kbuf.h io_uring/kbuf: fix not advancing READV kbuf ring 2022-09-07 10:36:10 -06:00
msg_ring.c io_uring/msg_ring: Fix NULL pointer dereference in io_msg_send_fd() 2022-10-29 10:08:35 +02:00
msg_ring.h
net.c io_uring/net: fail zc send when unsupported by socket 2022-10-26 12:22:55 +02:00
net.h io_uring/net: rename io_sendzc() 2022-10-21 12:39:27 +02:00
nop.c
nop.h
notif.c io_uring/notif: Remove the unused function io_notif_complete() 2022-09-05 11:42:39 -06:00
notif.h io_uring/net: simplify zerocopy send user API 2022-09-01 09:13:33 -06:00
opdef.c io_uring/net: rename io_sendzc() 2022-10-21 12:39:27 +02:00
opdef.h io_uring: add custom opcode hooks on fail 2022-10-21 12:37:32 +02:00
openclose.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
openclose.h
poll.c io_uring/poll: disable level triggered poll 2022-09-28 19:27:11 -06:00
poll.h
refs.h
rsrc.c io_uring/af_unix: defer registered files gc to io_uring release 2022-10-21 12:37:33 +02:00
rsrc.h Revert "io_uring: rename IORING_OP_FILES_UPDATE" 2022-09-01 09:13:33 -06:00
rw.c io_uring/rw: remove leftover debug statement 2022-10-29 10:08:33 +02:00
rw.h io_uring/rw: don't lose partial IO result on fail 2022-10-21 12:37:32 +02:00
slist.h
splice.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
splice.h
sqpoll.c
sqpoll.h
statx.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
statx.h
sync.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
sync.h
tctx.c
tctx.h
timeout.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
timeout.h
uring_cmd.c lsm/stable-6.0 PR 20220829 2022-08-31 09:23:16 -07:00
uring_cmd.h
xattr.c io_uring: make io_kiocb_to_cmd() typesafe 2022-08-12 17:01:00 -06:00
xattr.h