Skip to contentSkip to conversation

mm-fix-benign-off-by-one-bugs.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jan 21

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: fix benign off-by-one bugs
has been removed from the -mm tree. Its filename was
mm-fix-benign-off-by-one-bugs.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Alejandro Colomar <[email protected]>
Subject: mm: fix benign off-by-one bugs
Date: Thu, 11 Dec 2025 11:43:54 +0100

We were wasting a byte due to an off-by-one bug. s[c]nprintf() doesn't write more than $2 bytes including the null byte, so trying to pass 'size-1' there is wasting one byte.

---

 mm/kfence/kfence_test.c |    4 ++--
 mm/kmsan/kmsan_test.c   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
mm/kfence/kfence_test.c renamed from mm/kfence/kfence_test.c~mm-fix-benign-off-by-one-bugs +2 -2
@@ -110,7 +110,7 @@ static bool report_matches(const struct
 
 	/* Title */
 	cur = expect[0];
-	end = &expect[0][sizeof(expect[0]) - 1];
+	end = ARRAY_END(expect[0]);
 	switch (r->type) {
 	case KFENCE_ERROR_OOB:
 		cur += scnprintf(cur, end - cur, "BUG: KFENCE: out-of-bounds %s",
@@ -140,7 +140,7 @@ static bool report_matches(const struct
 
 	/* Access information */
 	cur = expect[1];
-	end = &expect[1][sizeof(expect[1]) - 1];
+	end = ARRAY_END(expect[1]);
 
 	switch (r->type) {
 	case KFENCE_ERROR_OOB:
mm/kmsan/kmsan_test.c renamed from mm/kmsan/kmsan_test.c~mm-fix-benign-off-by-one-bugs +1 -1
@@ -105,7 +105,7 @@ static bool report_matches(const struct
 
 	/* Title */
 	cur = expected_header;
-	end = &expected_header[sizeof(expected_header) - 1];
+	end = ARRAY_END(expected_header);
 
 	cur += scnprintf(cur, end - cur, "BUG: KMSAN: %s", r->error_type);
 

_

Patches currently in -mm which might be from [email protected] are