io_uring: fix race between timeout flush and removal
authorJens Axboe <axboe@kernel.dk>
Fri, 8 Apr 2022 17:08:58 +0000 (11:08 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 19:01:08 +0000 (21:01 +0200)
commit2827328e646d0c2d3db1bfcad4b5f5016ce0d643
tree0987ea16d7a5023497a9175109b403a4a0dffd4b
parentf7e183b0a7136b6dc9c7b9b2a85a608a8feba894
io_uring: fix race between timeout flush and removal

commit e677edbcabee849bfdd43f1602bccbecf736a646 upstream.

io_flush_timeouts() assumes the timeout isn't in progress of triggering
or being removed/canceled, so it unconditionally removes it from the
timeout list and attempts to cancel it.

Leave it on the list and let the normal timeout cancelation take care
of it.

Cc: stable@vger.kernel.org # 5.5+
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c