sst-linux/io_uring
Hagar Hemdan fdacd09f2d io_uring: fix possible deadlock in io_register_iowq_max_workers()
commit 73254a297c2dd094abec7c9efee32455ae875bdf upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-17 15:07:21 +01:00
..
advise.c
advise.h
alloc_cache.h
cancel.c
cancel.h
epoll.c
epoll.h
fdinfo.c
fdinfo.h
filetable.c
filetable.h
fs.c
fs.h
io_uring.c io_uring: fix possible deadlock in io_register_iowq_max_workers() 2024-11-17 15:07:21 +01:00
io_uring.h io_uring/sqpoll: close race on waiting for sqring entries 2024-10-22 15:56:45 +02:00
io-wq.c io_uring/io-wq: inherit cpuset of cgroup in io worker 2024-10-17 15:21:14 +02:00
io-wq.h
kbuf.c
kbuf.h
Makefile
msg_ring.c
msg_ring.h
net.c io_uring/net: harden multishot termination case for recv 2024-10-17 15:22:05 +02:00
net.h
nop.c
nop.h
notif.c
notif.h
opdef.c
opdef.h
openclose.c
openclose.h
poll.c
poll.h
refs.h
rsrc.c
rsrc.h
rw.c io_uring/rw: fix missing NOWAIT check for O_DIRECT start write 2024-11-08 16:26:47 +01:00
rw.h
slist.h
splice.c
splice.h
sqpoll.c io_uring/sqpoll: do not put cpumask on stack 2024-10-17 15:21:15 +02:00
sqpoll.h
statx.c
statx.h
sync.c
sync.h
tctx.c
tctx.h
timeout.c io_uring: fix io_match_task must_hold 2024-08-03 08:49:53 +02:00
timeout.h
uring_cmd.c
uring_cmd.h
xattr.c
xattr.h