linux/io_uring
Hagar Hemdan 73254a297c io_uring: fix possible deadlock in io_register_iowq_max_workers()
The io_register_iowq_max_workers() function calls io_put_sq_data(),
which acquires the sqd->lock without releasing the uring_lock.
Similar to the commit 009ad9f0c6 ("io_uring: drop ctx->uring_lock
before acquiring sqd->lock"), this can lead to a potential deadlock
situation.

To resolve this issue, the uring_lock is released before calling
io_put_sq_data(), and then it is re-acquired after the function call.

This change ensures that the locks are acquired in the correct
order, preventing the possibility of a deadlock.

Suggested-by: Maximilian Heyne <mheyne@amazon.de>
Signed-off-by: Hagar Hemdan <hagarhem@amazon.com>
Link: https://lore.kernel.org/r/20240604130527.3597-1-hagarhem@amazon.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-06-04 07:39:17 -06:00
..
advise.c
advise.h
alloc_cache.h
cancel.c
cancel.h
epoll.c
epoll.h
fdinfo.c
fdinfo.h
filetable.c io_uring/filetable: don't unnecessarily clear/reset bitmap 2024-05-08 08:27:45 -06:00
filetable.h
fs.c
fs.h
futex.c
futex.h
io_uring.c io_uring: remove checks for NULL 'sq_offset' 2024-05-22 11:13:44 -06:00
io_uring.h io_uring: check for non-NULL file pointer in io_file_can_poll() 2024-06-01 12:25:35 -06:00
io-wq.c io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue() 2024-06-04 07:39:00 -06:00
io-wq.h
kbuf.c
kbuf.h
Makefile
memmap.c io_uring: don't attempt to mmap larger than what the user asks for 2024-05-29 09:53:14 -06:00
memmap.h
msg_ring.c io_uring/msg_ring: cleanup posting to IOPOLL vs !IOPOLL ring 2024-05-01 17:13:51 -06:00
msg_ring.h
napi.c io_uring/napi: fix timeout calculation 2024-06-04 07:32:45 -06:00
napi.h
net.c io_uring/net: assign kmsg inq/flags before buffer selection 2024-05-30 14:04:37 -06:00
net.h
nop.c io_uring: support to inject result for NOP 2024-05-10 06:09:45 -06:00
nop.h
notif.c io_uring/notif: disable LAZY_WAKE for linked notifs 2024-04-30 13:06:27 -06:00
notif.h
opdef.c io_uring/rw: Free iovec before cleaning async data 2024-05-30 08:33:01 -06:00
opdef.h
openclose.c
openclose.h
poll.c
poll.h
refs.h
register.c io_uring: fix possible deadlock in io_register_iowq_max_workers() 2024-06-04 07:39:17 -06:00
register.h
rsrc.c
rsrc.h
rw.c Assorted commits that had missed the last merge window... 2024-05-21 13:11:44 -07:00
rw.h
slist.h
splice.c
splice.h
sqpoll.c io_uring/sqpoll: ensure that normal task_work is also run timely 2024-05-21 13:41:14 -06:00
sqpoll.h
statx.c
statx.h
sync.c
sync.h
tctx.c
tctx.h
timeout.c
timeout.h
truncate.c
truncate.h
uring_cmd.c
uring_cmd.h
waitid.c
waitid.h
xattr.c
xattr.h