]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
io_uring: fix io_prep_async_link locking
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 26 Jul 2021 13:14:31 +0000 (14:14 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 20 Sep 2021 13:42:31 +0000 (15:42 +0200)
commitd11b4485a523cbc072cd1106b5ddcf4c188b7722
tree7c699a48d034cb3b1c6fd328cf0be5fe89516663
parent5549f3ae36b0322e83c8d12607a598c60c096d3c
io_uring: fix io_prep_async_link locking

BugLink: https://bugs.launchpad.net/bugs/1940706
commit 44eff40a32e8f5228ae041006352e32638ad2368 upstream.

io_prep_async_link() may be called after arming a linked timeout,
automatically making it unsafe to traverse the linked list. Guard
with completion_lock if there was a linked timeout.

Cc: stable@vger.kernel.org # 5.9+
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/93f7c617e2b4f012a2a175b3dab6bc2f27cebc48.1627304436.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/io_uring.c