Skip to content

Commit ce66167

Browse files
thejhkees
authored andcommitted
ubsan: Clarify Kconfig text for CONFIG_UBSAN_TRAP
Make it clearer in the one-line description and the verbose description text that CONFIG_UBSAN_TRAP as currently implemented involves a tradeoff of much less helpful oops messages in exchange for a smaller kernel image. (With the additional effect of turning UBSAN warnings into crashes, which may or may not be desired.) Signed-off-by: Jann Horn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent fdf0eaf commit ce66167

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/Kconfig.ubsan

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ menuconfig UBSAN
1313
if UBSAN
1414

1515
config UBSAN_TRAP
16-
bool "On Sanitizer warnings, abort the running kernel code"
16+
bool "Abort on Sanitizer warnings (smaller kernel but less verbose)"
1717
depends on !COMPILE_TEST
1818
help
1919
Building kernels with Sanitizer features enabled tends to grow
@@ -26,6 +26,14 @@ config UBSAN_TRAP
2626
the system. For some system builders this is an acceptable
2727
trade-off.
2828

29+
Also note that selecting Y will cause your kernel to Oops
30+
with an "illegal instruction" error with no further details
31+
when a UBSAN violation occurs. (Except on arm64, which will
32+
report which Sanitizer failed.) This may make it hard to
33+
determine whether an Oops was caused by UBSAN or to figure
34+
out the details of a UBSAN violation. It makes the kernel log
35+
output less useful for bug reports.
36+
2937
config CC_HAS_UBSAN_BOUNDS_STRICT
3038
def_bool $(cc-option,-fsanitize=bounds-strict)
3139
help

0 commit comments

Comments
 (0)