All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] lib/bch: fix undefined behavior from signed left-shifts
@ 2026-03-18  7:48 Josh Law
  2026-03-18  7:48 ` [PATCH 1/2] lib/bch: fix signed left-shift undefined behavior Josh Law
  2026-03-18  7:48 ` [PATCH 2/2] lib/bch: fix signed shift overflow in build_mod8_tables Josh Law
  0 siblings, 2 replies; 3+ messages in thread
From: Josh Law @ 2026-03-18  7:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Josh Law, linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-18  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18  7:48 [PATCH 0/2] lib/bch: fix undefined behavior from signed left-shifts Josh Law
2026-03-18  7:48 ` [PATCH 1/2] lib/bch: fix signed left-shift undefined behavior Josh Law
2026-03-18  7:48 ` [PATCH 2/2] lib/bch: fix signed shift overflow in build_mod8_tables Josh Law

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.