io_uring: bump poll refs to full 31-bits
authorJens Axboe <axboe@kernel.dk>
Mon, 29 Aug 2022 13:30:21 +0000 (14:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Sep 2022 08:30:05 +0000 (10:30 +0200)
commitc41e79a0c46457dc87d56db59c4dc93be2e38568
tree17bb941dfac37ecb8070a8a86563d2d1306a4a1e
parent7524ec52caa893a3aeae85488f19dc2f71c8e7b9
io_uring: bump poll refs to full 31-bits

[ upstream commmit e2c0cb7c0cc72939b61a7efee376206725796625 ]

The previous commit:

1bc84c40088 ("io_uring: remove poll entry from list when canceling all")

removed a potential overflow condition for the poll references. They
are currently limited to 20-bits, even if we have 31-bits available. The
upper bit is used to mark for cancelation.

Bump the poll ref space to 31-bits, making that kind of situation much
harder to trigger in general. We'll separately add overflow checking
and handling.

Fixes: aa43477b0402 ("io_uring: poll rework")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
[pavel: backport]
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c