]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
io_uring: fix ltout double free on completion race
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 14 May 2021 11:02:50 +0000 (12:02 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:28:00 +0000 (08:28 +0200)
commit0f3c2fa1c0a71aed0db27fdb98aa901b39a53a21
tree061ef50949b0d63b6a2931d905989cb4c9b7e957
parenta7179fa5be203e208ff13d886d434cdb8a676cad
io_uring: fix ltout double free on completion race

BugLink: https://bugs.launchpad.net/bugs/1933691
[ Upstream commit 447c19f3b5074409c794b350b10306e1da1ef4ba ]

Always remove linked timeout on io_link_timeout_fn() from the master
request link list, otherwise we may get use-after-free when first
io_link_timeout_fn() puts linked timeout in the fail path, and then
will be found and put on master's free.

Cc: stable@vger.kernel.org # 5.10+
Fixes: 90cd7e424969d ("io_uring: track link timeout's master explicitly")
Reported-and-tested-by: syzbot+5a864149dd970b546223@syzkaller.appspotmail.com
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/69c46bf6ce37fec4fdcd98f0882e18eb07ce693a.1620990121.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/io_uring.c