]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring: protect cq_timeouts with timeout_lock
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 2 Dec 2022 17:47:22 +0000 (17:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:53 +0000 (13:26 +0100)
commit223ba1d1f06aab7752b104f1d64158025d1ff297
tree8a5ea3aaa41cd2ee72f70dba2020a738a04f3577
parent1011a5f52bc365d1592e251ed728b102dec0ef72
io_uring: protect cq_timeouts with timeout_lock

commit ea011ee10231f5fa6cbb415007048ca0bb948baf upstream.

Read cq_timeouts in io_flush_timeouts() only after taking the
timeout_lock, as it's protected by it. There are many places where we
also grab ->completion_lock, but for instance io_timeout_fn() doesn't
and still modifies cq_timeouts.

Cc: stable@vger.kernel.org
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9c79544dd6cf5c4018cb1bab99cf481a93ea46ef.1670002973.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/timeout.c