io_uring/poll: serialize poll linked timer start with poll removal
authorJens Axboe <axboe@kernel.dk>
Sun, 18 Jun 2023 01:50:24 +0000 (19:50 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jun 2023 09:12:27 +0000 (11:12 +0200)
commit24f473769e7ecf35e2772469a063d5a8bbca6f63
tree8b97d9ec105f43add448c29c04c9943692078955
parent2d80c85fa404ca973e56f1ac98f20d87151e6af1
io_uring/poll: serialize poll linked timer start with poll removal

Commit ef7dfac51d8ed961b742218f526bd589f3900a59 upstream.

We selectively grab the ctx->uring_lock for poll update/removal, but
we really should grab it from the start to fully synchronize with
linked timeouts. Normally this is indeed the case, but if requests
are forced async by the application, we don't fully cover removal
and timer disarm within the uring_lock.

Make this simpler by having consistent locking state for poll removal.

Cc: stable@vger.kernel.org # 6.1+
Reported-by: Querijn Voet <querijnqyn@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/poll.c