forked from Minki/linux
2e903b9147
Provide implementation of KASAN functions required for the hardware tag-based mode. Those include core functions for memory and pointer tagging (tags_hw.c) and bug reporting (report_tags_hw.c). Also adapt common KASAN code to support the new mode. Link: https://lkml.kernel.org/r/cfd0fbede579a6b66755c98c88c108e54f9c56bf.1606161801.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Alexander Potapenko <glider@google.com> Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Branislav Rankov <Branislav.Rankov@arm.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Evgenii Stepanov <eugenis@google.com> Cc: Kevin Brodsky <kevin.brodsky@arm.com> Cc: Marco Elver <elver@google.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
42 lines
1.7 KiB
Makefile
42 lines
1.7 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
KASAN_SANITIZE := n
|
|
UBSAN_SANITIZE := n
|
|
KCOV_INSTRUMENT := n
|
|
|
|
# Disable ftrace to avoid recursion.
|
|
CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_generic.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_quarantine.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_report.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_report_generic.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_report_hw_tags.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_report_sw_tags.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_shadow.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_hw_tags.o = $(CC_FLAGS_FTRACE)
|
|
CFLAGS_REMOVE_sw_tags.o = $(CC_FLAGS_FTRACE)
|
|
|
|
# Function splitter causes unnecessary splits in __asan_load1/__asan_store1
|
|
# see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533
|
|
CC_FLAGS_KASAN_RUNTIME := $(call cc-option, -fno-conserve-stack)
|
|
CC_FLAGS_KASAN_RUNTIME += -fno-stack-protector
|
|
# Disable branch tracing to avoid recursion.
|
|
CC_FLAGS_KASAN_RUNTIME += -DDISABLE_BRANCH_PROFILING
|
|
|
|
CFLAGS_common.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_generic.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_init.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_quarantine.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_report.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_report_generic.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_report_hw_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_report_sw_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_shadow.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_hw_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
CFLAGS_sw_tags.o := $(CC_FLAGS_KASAN_RUNTIME)
|
|
|
|
obj-$(CONFIG_KASAN) := common.o report.o
|
|
obj-$(CONFIG_KASAN_GENERIC) += init.o generic.o report_generic.o shadow.o quarantine.o
|
|
obj-$(CONFIG_KASAN_HW_TAGS) += hw_tags.o report_hw_tags.o
|
|
obj-$(CONFIG_KASAN_SW_TAGS) += init.o report_sw_tags.o shadow.o sw_tags.o
|