Commit 2fb857bc authored by Rohan McLure's avatar Rohan McLure Committed by Michael Ellerman

powerpc/kcsan: Add exclusions from instrumentation

Exclude various incompatible compilation units from KCSAN
instrumentation.
Signed-off-by: default avatarRohan McLure <rmclure@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230206021801.105268-2-rmclure@linux.ibm.com
parent 1ee4e350
...@@ -54,6 +54,13 @@ CFLAGS_cputable.o += -DDISABLE_BRANCH_PROFILING ...@@ -54,6 +54,13 @@ CFLAGS_cputable.o += -DDISABLE_BRANCH_PROFILING
CFLAGS_btext.o += -DDISABLE_BRANCH_PROFILING CFLAGS_btext.o += -DDISABLE_BRANCH_PROFILING
endif endif
KCSAN_SANITIZE_early_32.o := n
KCSAN_SANITIZE_early_64.o := n
KCSAN_SANITIZE_cputable.o := n
KCSAN_SANITIZE_btext.o := n
KCSAN_SANITIZE_paca.o := n
KCSAN_SANITIZE_setup_64.o := n
#ifdef CONFIG_RANDOMIZE_KSTACK_OFFSET #ifdef CONFIG_RANDOMIZE_KSTACK_OFFSET
# Remove stack protector to avoid triggering unneeded stack canary # Remove stack protector to avoid triggering unneeded stack canary
# checks due to randomize_kstack_offset. # checks due to randomize_kstack_offset.
...@@ -177,12 +184,15 @@ obj-$(CONFIG_PPC_SECVAR_SYSFS) += secvar-sysfs.o ...@@ -177,12 +184,15 @@ obj-$(CONFIG_PPC_SECVAR_SYSFS) += secvar-sysfs.o
# Disable GCOV, KCOV & sanitizers in odd or sensitive code # Disable GCOV, KCOV & sanitizers in odd or sensitive code
GCOV_PROFILE_prom_init.o := n GCOV_PROFILE_prom_init.o := n
KCOV_INSTRUMENT_prom_init.o := n KCOV_INSTRUMENT_prom_init.o := n
KCSAN_SANITIZE_prom_init.o := n
UBSAN_SANITIZE_prom_init.o := n UBSAN_SANITIZE_prom_init.o := n
GCOV_PROFILE_kprobes.o := n GCOV_PROFILE_kprobes.o := n
KCOV_INSTRUMENT_kprobes.o := n KCOV_INSTRUMENT_kprobes.o := n
KCSAN_SANITIZE_kprobes.o := n
UBSAN_SANITIZE_kprobes.o := n UBSAN_SANITIZE_kprobes.o := n
GCOV_PROFILE_kprobes-ftrace.o := n GCOV_PROFILE_kprobes-ftrace.o := n
KCOV_INSTRUMENT_kprobes-ftrace.o := n KCOV_INSTRUMENT_kprobes-ftrace.o := n
KCSAN_SANITIZE_kprobes-ftrace.o := n
UBSAN_SANITIZE_kprobes-ftrace.o := n UBSAN_SANITIZE_kprobes-ftrace.o := n
GCOV_PROFILE_syscall_64.o := n GCOV_PROFILE_syscall_64.o := n
KCOV_INSTRUMENT_syscall_64.o := n KCOV_INSTRUMENT_syscall_64.o := n
......
...@@ -23,4 +23,5 @@ obj-$(CONFIG_PPC32) += $(obj32-y) ...@@ -23,4 +23,5 @@ obj-$(CONFIG_PPC32) += $(obj32-y)
# Disable GCOV, KCOV & sanitizers in odd or sensitive code # Disable GCOV, KCOV & sanitizers in odd or sensitive code
GCOV_PROFILE_ftrace.o := n GCOV_PROFILE_ftrace.o := n
KCOV_INSTRUMENT_ftrace.o := n KCOV_INSTRUMENT_ftrace.o := n
KCSAN_SANITIZE_ftrace.o := n
UBSAN_SANITIZE_ftrace.o := n UBSAN_SANITIZE_ftrace.o := n
...@@ -46,6 +46,7 @@ GCOV_PROFILE := n ...@@ -46,6 +46,7 @@ GCOV_PROFILE := n
KCOV_INSTRUMENT := n KCOV_INSTRUMENT := n
UBSAN_SANITIZE := n UBSAN_SANITIZE := n
KASAN_SANITIZE := n KASAN_SANITIZE := n
KCSAN_SANITIZE := n
ccflags-y := -shared -fno-common -fno-builtin -nostdlib -Wl,--hash-style=both ccflags-y := -shared -fno-common -fno-builtin -nostdlib -Wl,--hash-style=both
ccflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) ccflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld)
......
...@@ -16,6 +16,8 @@ KASAN_SANITIZE_feature-fixups.o := n ...@@ -16,6 +16,8 @@ KASAN_SANITIZE_feature-fixups.o := n
# restart_table.o contains functions called in the NMI interrupt path # restart_table.o contains functions called in the NMI interrupt path
# which can be in real mode. Disable KASAN. # which can be in real mode. Disable KASAN.
KASAN_SANITIZE_restart_table.o := n KASAN_SANITIZE_restart_table.o := n
KCSAN_SANITIZE_code-patching.o := n
KCSAN_SANITIZE_feature-fixups.o := n
ifdef CONFIG_KASAN ifdef CONFIG_KASAN
CFLAGS_code-patching.o += -DDISABLE_BRANCH_PROFILING CFLAGS_code-patching.o += -DDISABLE_BRANCH_PROFILING
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
KASAN_SANITIZE := n KASAN_SANITIZE := n
KCSAN_SANITIZE := n
targets += trampoline_$(BITS).o purgatory.ro targets += trampoline_$(BITS).o purgatory.ro
......
...@@ -5,6 +5,7 @@ GCOV_PROFILE := n ...@@ -5,6 +5,7 @@ GCOV_PROFILE := n
KCOV_INSTRUMENT := n KCOV_INSTRUMENT := n
UBSAN_SANITIZE := n UBSAN_SANITIZE := n
KASAN_SANITIZE := n KASAN_SANITIZE := n
KCSAN_SANITIZE := n
# Disable ftrace for the entire directory # Disable ftrace for the entire directory
ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment