[PATCH 0/2] lib/bch: fix undefined behavior from signed left-shifts

From: Josh Law

Date: Wed Mar 18 2026 - 03:54:09 EST


Fix two instances of undefined behavior in lib/bch.c caused by
left-shifting signed integers into or past the sign bit.

While the kernel's -fno-strict-overflow flag prevents miscompilation
today, these are formally UB per C11 6.5.7p4 and trivial to fix.

Josh Law (2):
lib/bch: fix signed left-shift undefined behavior
lib/bch: fix signed shift overflow in build_mod8_tables

lib/bch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--
2.34.1