]> git.ipfire.org Git - thirdparty/linux.git/commit
io_uring/kbuf: limit legacy provided buffer lists to USHRT_MAX
authorJens Axboe <axboe@kernel.dk>
Tue, 3 Jun 2025 13:42:28 +0000 (07:42 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Jun 2025 21:32:44 +0000 (15:32 -0600)
commit607d09d1a01e9f29e91733e3a08b63ed240aacb2
treed06e429f7822708192e37602063b73640536f321
parente931d3a9d5200bae9d938be2582072b2898e37f7
io_uring/kbuf: limit legacy provided buffer lists to USHRT_MAX

The buffer ID for a provided buffer is an unsigned short, and hence
there can only be 64k added to any given buffer list before having
duplicate BIDs. Cap the legacy provided buffers at 64k in the list.
This is mostly to prevent silly stall reports from syzbot, which
likes to dump tons of buffers into a list and then have kernels with
lockdep and kasan churning through them and hitting long wait times
for buffer pruning at ring exit time.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c
io_uring/kbuf.h