ARM: 9253/1: ubsan: select ARCH_HAS_UBSAN_SANITIZE_ALL
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 30 Sep 2022 21:30:09 +0000 (22:30 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 7 Nov 2022 14:19:00 +0000 (14:19 +0000)
To enable UBSAN on ARM, this patch enables ARCH_HAS_UBSAN_SANITIZE_ALL
from arm confiuration. Basic kernel bootup test is passed on arm with
CONFIG_UBSAN_SANITIZE_ALL enabled.

[florian: rebased against v6.0-rc7]

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/Kconfig
arch/arm/boot/compressed/Makefile
arch/arm/vdso/Makefile

index 87badea..c90aa58 100644 (file)
@@ -27,6 +27,7 @@ config ARM
        select ARCH_HAVE_NMI_SAFE_CMPXCHG if CPU_V7 || CPU_V7M || CPU_V6K
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_KEEP_MEMBLOCK
+       select ARCH_HAS_UBSAN_SANITIZE_ALL
        select ARCH_MIGHT_HAVE_PC_PARPORT
        select ARCH_NO_SG_CHAIN if !ARM_HAS_SG_CHAIN
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
index 41bcbb4..2cc2af1 100644 (file)
@@ -27,6 +27,7 @@ KASAN_SANITIZE                := n
 
 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
 KCOV_INSTRUMENT                := n
+UBSAN_SANITIZE         := n
 
 #
 # Architecture dependencies
index 8ca1c9f..a7ec06c 100644 (file)
@@ -37,6 +37,7 @@ endif
 
 # Disable gcov profiling for VDSO code
 GCOV_PROFILE := n
+UBSAN_SANITIZE := n
 
 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
 KCOV_INSTRUMENT := n