linux/io_uring
Jérémy Jean 6ca662cc71 io_uring/rsrc: reject overflowing regvec bvec byte counts
io_import_reg_vec() converts the estimated number of bio_vec entries
into iovec-sized storage when struct bio_vec is larger than struct
iovec. The conversion still multiplies nr_segs by sizeof(struct
bio_vec) in size_t without checking for overflow.

On 32-bit kernels, a registered buffer large enough to make
io_estimate_bvec_size() return 357913942 segments wraps the byte count
from 0x100000008 to 8. io_vec_realloc() then reserves only the input
iovecs plus one extra slot while io_vec_fill_bvec() writes the full
bio_vec array.

Check both the multiplication and the rounding addition before
deriving the replacement iovec count.

Fixes: b4e41050b2 ("io_uring/rsrc: raise registered buffer 1GB limit")
Assisted-by: Codex:gpt-5
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Link: https://patch.msgid.link/20260812203042.720348-1-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-08-12 19:53:35 -06:00
..
advise.c
advise.h
alloc_cache.c
alloc_cache.h
bpf_filter.c
bpf_filter.h
bpf-ops.c io_uring/bpf-ops: reject re-registration of an already-bound ops 2026-07-17 11:17:54 -06:00
bpf-ops.h io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
cancel.c io_uring: preserve task restrictions across exec 2026-07-30 14:40:22 -06:00
cancel.h
cmd_net.c
epoll.c Revert "io_uring/epoll: disallow adding an epoll file to an epoll context" 2026-07-30 10:36:06 -06:00
epoll.h
eventfd.c
eventfd.h
fdinfo.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
fdinfo.h
filetable.c
filetable.h
fs.c io_uring/fs: check unused sqe fields for unlinkat 2026-07-14 13:18:11 -06:00
fs.h
futex.c futex: Add support for unlocking robust futexes 2026-06-03 11:38:51 +02:00
futex.h
io_uring.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
io_uring.h io_uring/zcrx: notify user when out of buffers 2026-05-26 10:42:01 -06:00
io-wq.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
io-wq.h
kbuf.c io_uring/kbuf: cap buffer selection length at MAX_RW_COUNT 2026-07-30 10:33:05 -06:00
kbuf.h
Kconfig
loop.c io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
loop.h io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
Makefile
memmap.c io_uring/memmap: return -EINVAL from get_unmapped_area() on bad mmap 2026-07-01 05:37:07 -06:00
memmap.h
mock_file.c
mpscq.h io_uring: get rid of tw_pending for !DEFER task work 2026-06-16 09:48:00 -06:00
msg_ring.c io_uring/msg_ring: reject CQE32 flag pass-through to normal rings 2026-07-01 05:39:26 -06:00
msg_ring.h
napi.c
napi.h
net.c io_uring/net: initialize mshot_len for send 2026-07-30 10:33:05 -06:00
net.h
nop.c io_uring/nop: fix file reference leak with IOSQE_FIXED_FILE 2026-06-16 06:20:01 -06:00
nop.h
notif.c
notif.h
opdef.c io_uring, audit: don't log IORING_OP_RECV_ZC 2026-06-16 09:48:42 -06:00
opdef.h
openclose.c
openclose.h
poll.c
poll.h
query.c io_uring/zcrx: rename notif to event 2026-07-22 09:48:42 -06:00
query.h
refs.h
register.c io_uring/register: preserve SQ array entries on resize 2026-06-16 10:06:49 -06:00
register.h
rsrc.c io_uring/rsrc: reject overflowing regvec bvec byte counts 2026-08-12 19:53:35 -06:00
rsrc.h
rw.c io_uring/rw: fix missing ERESTARTSYS conversion in read paths 2026-07-22 07:36:25 -06:00
rw.h
slist.h
splice.c
splice.h
sqpoll.c io_uring: switch normal task_work to a mpscq 2026-06-13 06:27:11 -06:00
sqpoll.h
statx.c
statx.h
sync.c
sync.h
tctx.c io_uring: preserve task restrictions across exec 2026-07-30 14:40:22 -06:00
tctx.h io_uring: preserve task restrictions across exec 2026-07-30 14:40:22 -06:00
timeout.c
timeout.h
truncate.c
truncate.h
tw.c Revert "io_uring: grab RCU read lock marking task run" 2026-07-09 11:43:07 -06:00
tw.h io_uring: remove the per-ctx fallback task_work machinery 2026-06-13 06:27:20 -06:00
uring_cmd.c io_uring/uring_cmd: fix uring_cmd.c comments 2026-07-02 14:15:19 -06:00
uring_cmd.h
wait.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
wait.h io_uring: switch local task_work to a mpscq 2026-06-13 06:27:06 -06:00
waitid.c
waitid.h
xattr.c
xattr.h
zcrx.c io_uring/zcrx: don't clear master_ctx from the import path 2026-07-30 13:18:06 -06:00
zcrx.h io_uring/zcrx: rename notif to event 2026-07-22 09:48:42 -06:00