Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit e0ee9676 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/kbuf: sanitize peek buffer setup

Harden the buffer peeking a bit, by adding a sanity check for it having
a valid size. Outside of that, arg->max_len is a size_t, though it's
only ever set to a 32-bit value (as it's governed by MAX_RW_COUNT).
Bump our needed check to a size_t so we know it fits. Finally, cap the
calculated needed iov value to the PEEK_MAX_IMPORT, which is the
maximum number of segments that should be peeked.

Fixes: 35c8711c

 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1fc2ac42
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