path: root/lib/Kconfig.ubsan
diff options
authorKees Cook <>2020-06-01 21:52:46 -0700
committerLinus Torvalds <>2020-06-02 10:59:12 -0700
commit9380ce246a052a1e00121cd480028b6907aeae38 (patch)
tree4a031adb90a6030aad710d36e9b2f76f752349cd /lib/Kconfig.ubsan
parentca734cc67e3c8ce20eb75dd1e45ae86e10be102b (diff)
ubsan: entirely disable alignment checks under UBSAN_TRAP
Commit 8d58f222e85f ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") tried to fix the pathological results of UBSAN_ALIGNMENT with UBSAN_TRAP (which objtool would rightly scream about), but it made an assumption about how COMPILE_TEST gets set (it is not set for randconfig). As a result, we need a bigger hammer here: just don't allow the alignment checks with the trap mode. Fixes: 8d58f222e85f ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") Reported-by: Randy Dunlap <> Signed-off-by: Kees Cook <> Signed-off-by: Andrew Morton <> Acked-by: Randy Dunlap <> Cc: Josh Poimboeuf <> Cc: Dmitry Vyukov <> Cc: Elena Petrova <> Link: Link: Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'lib/Kconfig.ubsan')
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 929211039bac..27bcc2568c95 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -63,7 +63,7 @@ config UBSAN_SANITIZE_ALL
bool "Enable checks for pointers alignment"
- depends on !X86 || !COMPILE_TEST
+ depends on !UBSAN_TRAP
This option enables the check of unaligned memory accesses.
Enabling this option on architectures that support unaligned