]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
io_uring: fix ->flags races by linked timeouts
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 14 Mar 2021 20:57:08 +0000 (20:57 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 8 Apr 2021 20:42:45 +0000 (15:42 -0500)
commita81a26c850775d4ef96eba76acaeac2a3a9d368b
treea48b7524cd8ed17b50e817956a3ec89db6faad0e
parentd0de0183287d2f54939b4e68b6e59be6d15dad9f
io_uring: fix ->flags races by linked timeouts

BugLink: https://bugs.launchpad.net/bugs/1923069
[ Upstream commit efe814a471e0e58f28f1efaf430c8784a4f36626 ]

It's racy to modify req->flags from a not owning context, e.g. linked
timeout calling req_set_fail_links() for the master request might race
with that request setting/clearing flags while being executed
concurrently. Just remove req_set_fail_links(prev) from
io_link_timeout_fn(), io_async_find_and_cancel() and functions down the
line take care of setting the fail bit.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/io_uring.c