]> git.baikalelectronics.ru Git - 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)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 May 2021 12:06:15 +0000 (06:06 -0600)
commit1eaa8de1c4852d5a77b0d14ee3ae7fee9ff86e3a
tree5839f4dfe4998bd3ddee091dc23c2fe4fb8d9427
parent9e1b88efc529037b87f8a79c5362a20cc830f48a
io_uring: fix ltout double free on completion race

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: 916aa80503f0d ("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>
fs/io_uring.c