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 18:59:22 +0000 (20:59 +0200)
commitba7261af2b030ab2c06189be1fc77b273716839f
tree6f556d5de5b5a2f6e65a65ef0cab5a16cb43fb81
parentfe223dd2f18b30dea66cee1174908a934e942e33
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