Skip to contentSkip to conversation

FAILED: patch "[PATCH] io_uring: fix off-by one bvec index" failed to apply to 6.1-stable tree

PATCH [email protected] 2 participants 2 messages Nov 30, 2023

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-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 <[email protected]>.

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.1.y
git checkout FETCH_HEAD
git cherry-pick -x d6fef34ee4d102be448146f24caf96d7b4a05401
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023113023-heaviness-easel-554e@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..

Possible dependencies:

d6fef34ee4d1 ("io_uring: fix off-by one bvec index") 57bebf807e2a ("io_uring/rsrc: optimise registered huge pages") b000ae0ec2d7 ("io_uring/rsrc: optimise single entry advance")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From d6fef34ee4d102be448146f24caf96d7b4a05401 Mon Sep 17 00:00:00 2001
From: Keith Busch <[email protected]>
Date: Mon, 20 Nov 2023 14:18:31 -0800
Subject: [PATCH] io_uring: fix off-by one bvec index

If the offset equals the bv_len of the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation.

Fixes bd11b3a391e3 ("io_uring: don't use iov_iter_advance() for fixed buffers")
io_uring/rsrc.c +1 -1
index 7034be555334..f521c5965a93 100644
@@ -1258,7 +1258,7 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
 		 */
 		const struct bio_vec *bvec = imu->bvec;
 
-		if (offset <= bvec->bv_len) {
+		if (offset < bvec->bv_len) {
 			/*
 			 * Note, huge pages buffers consists of one large
 			 * bvec entry and should always go this way. The other
maintainer
#1 lore raw
Quoted 2 lines · On 11/30/23 7:31 AM, [email protected] wrote:

The patch below does not apply to the 6.1-stable tree.

Already tested these, here's the 6.1 variant.

Signature · 1 line
Jens Axboe

From 01636029775bcf023da73a6c094a371a0408ae0e Mon Sep 17 00:00:00 2001
From: Keith Busch <[email protected]>
Date: Mon, 20 Nov 2023 14:18:31 -0800
Subject: [PATCH] io_uring: fix off-by one bvec index

commit d6fef34ee4d102be448146f24caf96d7b4a05401 upstream.

If the offset equals the bv_len of the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation.

Fixes bd11b3a391e3 ("io_uring: don't use iov_iter_advance() for fixed buffers")
---
 io_uring/rsrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/rsrc.c +1 -1
index cce95164204f..7ada0339b387 100644
@@ -1351,7 +1351,7 @@ int io_import_fixed(int ddir, struct iov_iter *iter,
 		 */
 		const struct bio_vec *bvec = imu->bvec;
 
-		if (offset <= bvec->bv_len) {
+		if (offset < bvec->bv_len) {
 			iov_iter_advance(iter, offset);
 		} else {
 			unsigned long seg_skip;
Signature · 1 line
2.42.0