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:33:12 +0000 (13:33 +0100)
commit9b5d3f21f1aba54064f8f56694d09ee8d91daec3
tree4ab316e3c719398f7c72ed5da7c1152b9fea2452
parentf9ef51a7055cb1abd4b58d2a8fcb87db0a58ccf2
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