]> git.ipfire.org Git - thirdparty/linux.git/commit - lib/ubsan.c
ubsan: Add awareness of signed integer overflow traps
authorKees Cook <keescook@chromium.org>
Mon, 15 Apr 2024 18:28:35 +0000 (11:28 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 16 Apr 2024 00:42:43 +0000 (17:42 -0700)
commitf4626c12e4b538f757a73d08f4d86d564175b4f7
treee5c0d2ce5e701a2002f40e7cad95d53711d3cf4b
parent7fcb91d94e897413c0345bb32ea11293f33efbb1
ubsan: Add awareness of signed integer overflow traps

On arm64, UBSAN traps can be decoded from the trap instruction. Add the
add, sub, and mul overflow trap codes now that CONFIG_UBSAN_SIGNED_WRAP
exists. Seen under clang 19:

  Internal error: UBSAN: unrecognized failure code: 00000000f2005515 [#1] PREEMPT SMP

Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/lkml/20240411-fix-ubsan-in-hardening-config-v1-0-e0177c80ffaa@kernel.org
Fixes: 557f8c582a9b ("ubsan: Reintroduce signed overflow sanitizer")
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240415182832.work.932-kees@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
lib/ubsan.c