summaryrefslogtreecommitdiff
path: root/io_uring/poll.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-11-10 20:50:55 +0300
committerJens Axboe <axboe@kernel.dk>2022-11-10 21:07:41 +0300
commit3851d25c75ed03117268a8feb34adca5a843a126 (patch)
tree02ea2b907fadded9db12ee93d50b4f848dbeffab /io_uring/poll.c
parent0fc8c2acbfc789a977a50a4a9812a8e4b37958ce (diff)
downloadlinux-3851d25c75ed03117268a8feb34adca5a843a126.tar.xz
io_uring: check for rollover of buffer ID when providing buffers
We already check if the chosen starting offset for the buffer IDs fit within an unsigned short, as 65535 is the maximum value for a provided buffer. But if the caller asks to add N buffers at offset M, and M + N would exceed the size of the unsigned short, we simply add buffers with wrapping around the ID. This is not necessarily a bug and could in fact be a valid use case, but it seems confusing and inconsistent with the initial check for starting offset. Let's check for wrap consistently, and error the addition if we do need to wrap. Reported-by: Olivier Langlois <olivier@trillion01.com> Link: https://github.com/axboe/liburing/issues/726 Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.c')
0 files changed, 0 insertions, 0 deletions