io_uring: fail poll arm on queue proc failure
authorJens Axboe <axboe@kernel.dk>
Tue, 11 Aug 2020 15:50:19 +0000 (09:50 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:15 +0000 (08:24 +0200)
commitae189bfb784786e94b3b8826d01253500f95b605
tree5b18f66c9f0d1bc9b6abad7547731b932d600349
parent175852503b41b3b74ffd99789240fa21ea1b8584
io_uring: fail poll arm on queue proc failure

commit a36da65c46565d2527eec3efdb546251e38253fd upstream.

Check the ipt.error value, it must have been either cleared to zero or
set to another error than the default -EINVAL if we don't go through the
waitqueue proc addition. Just give up on poll at that point and return
failure, this will fallback to async work.

io_poll_add() doesn't suffer from this failure case, as it returns the
error value directly.

Cc: stable@vger.kernel.org # v5.7+
Reported-by: syzbot+a730016dc0bdce4f6ff5@syzkaller.appspotmail.com
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c