Skip to content

Commit 9380ce2

Browse files
keestorvalds
authored andcommitted
ubsan: entirely disable alignment checks under UBSAN_TRAP
Commit 8d58f22 ("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: 8d58f22 ("ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST") Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Randy Dunlap <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Elena Petrova <[email protected]> Link: http://lkml.kernel.org/r/202005291236.000FCB6@keescook Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Linus Torvalds <[email protected]>
1 parent ca734cc commit 9380ce2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Kconfig.ubsan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ config UBSAN_SANITIZE_ALL
6363
config UBSAN_ALIGNMENT
6464
bool "Enable checks for pointers alignment"
6565
default !HAVE_EFFICIENT_UNALIGNED_ACCESS
66-
depends on !X86 || !COMPILE_TEST
66+
depends on !UBSAN_TRAP
6767
help
6868
This option enables the check of unaligned memory accesses.
6969
Enabling this option on architectures that support unaligned

0 commit comments

Comments
 (0)