* [PATCH v1 1/1] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select()
@ 2026-11-16 19:31 Siddharth Chintamaneni
0 siblings, 0 replies; only message in thread
From: Siddharth Chintamaneni @ 2026-11-16 19:31 UTC (permalink / raw)
To: Jens Axboe
Cc: io-uring, linux-kernel, Rachel Menge, Hardik Garg,
Siddharth Chintamaneni
io_buffers_select() passes &arg->out_len to io_provided_buffers_select()
on the legacy provided-buffer path. Because callers initialize
arg->max_len (from sqe->len) while leaving arg->out_len as 0,
io_provided_buffers_select() sees *len == 0 and always selects the full
buffer size buf->len, ignoring the user-specified sqe->len limit.
Initialize arg->out_len = arg->max_len before calling
io_provided_buffers_select().
Fixes: 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
Signed-off-by: Siddharth Chintamaneni <sidchintamaneni@gmail.com>
---
io_uring/kbuf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index abf44f5dba26..873d66a06b36 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -370,6 +370,7 @@ int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg,
req->flags |= REQ_F_BUF_MORE;
}
} else {
+ arg->out_len = arg->max_len;
ret = io_provided_buffers_select(req, &arg->out_len, sel->buf_list, arg->iovs);
}
out_unlock:
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-16 19:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 19:31 [PATCH v1 1/1] io_uring/kbuf: initialize arg->out_len from arg->max_len in io_buffers_select() Siddharth Chintamaneni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®