Skip to content
Commit d4e7cd36 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: sanitize double poll handling



There's a bit of confusion on the matching pairs of poll vs double poll,
depending on if the request is a pure poll (IORING_OP_POLL_ADD) or
poll driven retry.

Add io_poll_get_double() that returns the double poll waitqueue, if any,
and io_poll_get_single() that returns the original poll waitqueue. With
that, remove the argument to io_poll_remove_double().

Finally ensure that wait->private is cleared once the double poll handler
has run, so that remove knows it's already been seen.

Cc: stable@vger.kernel.org # v5.8
Reported-by: default avatar <syzbot+7f617d4a9369028b8a2c@syzkaller.appspotmail.com>
Fixes: 18bceab1

 ("io_uring: allow POLL_ADD with double poll_wait() users")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 227c0c96
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment