* FAILED: patch "[PATCH] io_uring/kbuf: don't truncate end buffer for bundles" failed to apply to 6.18-stable tree
@ 2026-06-15 14:18 gregkh
2026-06-15 14:39 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2026-06-15 14:18 UTC (permalink / raw)
To: axboe, federico.brasili; +Cc: stable
The patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 70f4886bcbb929e88038c8807f1daf7fc587ae7c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026061524-overtone-renovate-0e4d@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 70f4886bcbb929e88038c8807f1daf7fc587ae7c Mon Sep 17 00:00:00 2001
From: Jens Axboe <axboe@kernel.dk>
Date: Sun, 7 Jun 2026 16:05:47 -0600
Subject: [PATCH] io_uring/kbuf: don't truncate end buffer for bundles
If buffers have been peeked for a bundle receive, the kernel will
truncate the end buffer, if the available length is shorter than the
buffer itself. This is unnecessary, as applications iterating bundle
receives must always use the minimum size of the buffer length and the
remaining number of bytes in the bundle. The examples in liburing do
that as well, eg examples/proxy.c.
If the kernel does truncate this buffer AND the current transfer fails,
then the buffer will be left with a smaller size than what is otherwise
available.
Just remove the buffer truncation, as it's not necessary in the first
place.
Link: https://lore.kernel.org/io-uring/CAAEr8jbY60noGj1fw_k91UJRBkyiRVoS6=nLhZ7Svwidjn4CAA@mail.gmail.com/
Reported-by: Federico Brasili <federico.brasili@gmail.com>
Cc: stable@vger.kernel.org
Fixes: 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index 63061aa1cab9..926254b6898f 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -305,7 +305,6 @@ static int io_ring_buffers_peek(struct io_kiocb *req, struct buf_sel_arg *arg,
arg->partial_map = 1;
if (iov != arg->iovs)
break;
- WRITE_ONCE(buf->len, len);
}
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] io_uring/kbuf: don't truncate end buffer for bundles" failed to apply to 6.18-stable tree
2026-06-15 14:18 FAILED: patch "[PATCH] io_uring/kbuf: don't truncate end buffer for bundles" failed to apply to 6.18-stable tree gregkh
@ 2026-06-15 14:39 ` Jens Axboe
2026-06-15 15:21 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2026-06-15 14:39 UTC (permalink / raw)
To: gregkh, federico.brasili; +Cc: stable
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
On 6/15/26 8:18 AM, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 6.18-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
Here's one for 6.18-stable.
--
Jens Axboe
[-- Attachment #2: 0002-io_uring-kbuf-don-t-truncate-end-buffer-for-bundles.patch --]
[-- Type: text/x-patch, Size: 1618 bytes --]
From b01e74c189cc3e17fbb98f28f69245b259144429 Mon Sep 17 00:00:00 2001
From: Jens Axboe <axboe@kernel.dk>
Date: Sun, 7 Jun 2026 16:05:47 -0600
Subject: [PATCH 2/2] io_uring/kbuf: don't truncate end buffer for bundles
Commit 70f4886bcbb929e88038c8807f1daf7fc587ae7c upstream.
If buffers have been peeked for a bundle receive, the kernel will
truncate the end buffer, if the available length is shorter than the
buffer itself. This is unnecessary, as applications iterating bundle
receives must always use the minimum size of the buffer length and the
remaining number of bytes in the bundle. The examples in liburing do
that as well, eg examples/proxy.c.
If the kernel does truncate this buffer AND the current transfer fails,
then the buffer will be left with a smaller size than what is otherwise
available.
Just remove the buffer truncation, as it's not necessary in the first
place.
Link: https://lore.kernel.org/io-uring/CAAEr8jbY60noGj1fw_k91UJRBkyiRVoS6=nLhZ7Svwidjn4CAA@mail.gmail.com/
Reported-by: Federico Brasili <federico.brasili@gmail.com>
Cc: stable@vger.kernel.org
Fixes: 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
io_uring/kbuf.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index 32d3b8d26bf0..c260d5f34cf3 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -305,7 +305,6 @@ static int io_ring_buffers_peek(struct io_kiocb *req, struct buf_sel_arg *arg,
arg->partial_map = 1;
if (iov != arg->iovs)
break;
- buf->len = len;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] io_uring/kbuf: don't truncate end buffer for bundles" failed to apply to 6.18-stable tree
2026-06-15 14:39 ` Jens Axboe
@ 2026-06-15 15:21 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-06-15 15:21 UTC (permalink / raw)
To: Jens Axboe; +Cc: federico.brasili, stable
On Mon, Jun 15, 2026 at 08:39:00AM -0600, Jens Axboe wrote:
> On 6/15/26 8:18 AM, gregkh@linuxfoundation.org wrote:
> >
> > The patch below does not apply to the 6.18-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
>
> Here's one for 6.18-stable.
Both now queued up, thanks!
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-15 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-15 14:18 FAILED: patch "[PATCH] io_uring/kbuf: don't truncate end buffer for bundles" failed to apply to 6.18-stable tree gregkh
2026-06-15 14:39 ` Jens Axboe
2026-06-15 15:21 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox