Re: [PATCH] io_uring/kbuf: cap buffer selection length at MAX_RW_COUNT

Gabriel Krisman Bertazi <[email protected]> Sun, 26 Jul 2026 20:12:07 -0400
Newsgroups org.kernel.vger.io-uring
Organization SUSE
Message-ID <[email protected]>
Jens Axboe <[email protected]> writes:

> io_ring_buffers_peek() builds an iovec array from provided buffers, and
> that in turn can be handed off to a lower level provider. Be prudent and
> cap the total size to MAX_RW_COUNT, which is the Linux default for how
> much IO do to in a single call.
>
> No bugs here, but it's a good preventative measure to avoid truncation
> issues.
>
> Signed-off-by: Jens Axboe <[email protected]>

Reviewed-by: Gabriel Krisman Bertazi <[email protected]>