Skip to contentSkip to conversation

lib-bch-fix-signed-shift-overflow-in-build_mod8_tables.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Mar 28

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: lib/bch: fix signed shift overflow in build_mod8_tables
has been removed from the -mm tree. Its filename was
lib-bch-fix-signed-shift-overflow-in-build_mod8_tables.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: Josh Law <[email protected]>
Subject: lib/bch: fix signed shift overflow in build_mod8_tables
Date: Wed, 18 Mar 2026 07:48:06 +0000

Cast loop variable to unsigned int before left-shifting to avoid undefined behavior when i >= 128 and b == 3 (i << 24 overflows signed int).

---

 lib/bch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bch.c renamed from lib/bch.c~lib-bch-fix-signed-shift-overflow-in-build_mod8_tables +1 -1
@@ -1116,7 +1116,7 @@ static void build_mod8_tables(struct bch
 		for (b = 0; b < 4; b++) {
 			/* we want to compute (p(X).X^(8*b+deg(g))) mod g(X) */
 			tab = bch->mod8_tab + (b*256+i)*l;
-			data = i << (8*b);
+			data = (unsigned int)i << (8*b);
 			while (data) {
 				d = deg(data);
 				/* subtract X^d.g(X) from p(X).X^(8*b+deg(g)) */

_

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

mm-damon-core-document-damos_commit_dests-failure-semantics.patch lib-maple_tree-fix-swapped-arguments-in-mas_safe_pivot-call.patch lib-idr-fix-ida_find_first_range-missing-ids-across-chunk-boundaries.patch