twx-linux/io_uring
Pavel Begunkov c5d4d10300 io_uring: always do atomic put from iowq
[ Upstream commit 390513642ee6763c7ada07f0a1470474986e6c1c ]

io_uring always switches requests to atomic refcounting for iowq
execution before there is any parallilism by setting REQ_F_REFCOUNT,
and the flag is not cleared until the request completes. That should be
fine as long as the compiler doesn't make up a non existing value for
the flags, however KCSAN still complains when the request owner changes
oter flag bits:

BUG: KCSAN: data-race in io_req_task_cancel / io_wq_free_work
...
read to 0xffff888117207448 of 8 bytes by task 3871 on cpu 0:
 req_ref_put_and_test io_uring/refs.h:22 [inline]

Skip REQ_F_REFCOUNT checks for iowq, we know it's set.

Reported-by: syzbot+903a2ad71fb3f1e47cf5@syzkaller.appspotmail.com
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d880bc27fb8c3209b54641be4ff6ac02b0e5789a.1743679736.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-02 07:50:57 +02:00
..
advise.c
advise.h
alloc_cache.h
cancel.c io_uring: use fget/fput consistently 2024-01-20 11:51:38 +01:00
cancel.h
epoll.c
epoll.h
fdinfo.c
fdinfo.h
filetable.c io_uring: drop any code related to SCM_RIGHTS 2024-03-26 18:19:09 -04:00
filetable.h
fs.c
fs.h
io_uring.c io_uring: always do atomic put from iowq 2025-05-02 07:50:57 +02:00
io_uring.h io_uring/kbuf: use vm_insert_pages() for mmap'ed pbuf ring 2025-03-22 12:50:45 -07:00
io-wq.c io-wq: backoff when retrying worker creation 2025-03-22 12:50:43 -07:00
io-wq.h
kbuf.c io_uring/kbuf: reject zero sized provided buffers 2025-04-25 10:45:26 +02:00
kbuf.h io_uring/kbuf: use vm_insert_pages() for mmap'ed pbuf ring 2025-03-22 12:50:45 -07:00
Makefile
msg_ring.c
msg_ring.h
net.c io_uring/net: fix accept multishot handling 2025-04-25 10:45:54 +02:00
net.h
nop.c io_uring: fail NOP if non-zero op flags is passed in 2024-06-12 11:11:18 +02:00
nop.h
notif.c
notif.h
opdef.c
opdef.h
openclose.c
openclose.h
poll.c io_uring/net: don't retry connect operation on EPOLLERR 2025-02-17 09:40:36 +01:00
poll.h
refs.h io_uring: always do atomic put from iowq 2025-05-02 07:50:57 +02:00
rsrc.c io_uring: unify io_pin_pages() 2025-03-22 12:50:45 -07:00
rsrc.h io_uring: drop any code related to SCM_RIGHTS 2024-03-26 18:19:09 -04:00
rw.c io_uring/rw: commit provided buffer state on async 2025-02-17 09:40:37 +01:00
rw.h
slist.h
splice.c
splice.h
sqpoll.c io_uring/sqpoll: fix sqpoll error handling races 2025-01-02 10:32:10 +01:00
sqpoll.h
statx.c
statx.h
sync.c
sync.h
tctx.c io_uring/tctx: work around xa_store() allocation error issue 2024-12-14 20:00:17 +01:00
tctx.h
timeout.c io_uring/timeout: fix multishot updates 2025-01-17 13:36:19 +01:00
timeout.h
uring_cmd.c io_uring/uring_cmd: use cached cmd_op in io_uring_cmd_sock() 2025-02-08 09:52:33 +01:00
uring_cmd.h
xattr.c
xattr.h