Harshit Sharma has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43164 )
Change subject: lib: Update ASan compiler flags and Kconfig help text ......................................................................
lib: Update ASan compiler flags and Kconfig help text
An additional compiler flag is added to make use of the shadow offset callback feature we introduced in our GCC patch. Also, the help text of ASAN is updated to tell user that this GCC patch needs to be applied in order to use ASan.
Change-Id: Ia187e4991bf808f4ae137eff0ffdb9baea0085e9 Signed-off-by: Harshit Sharma harshitsharmajs@gmail.com --- M src/Kconfig M src/lib/Makefile.inc 2 files changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/43164/1
diff --git a/src/Kconfig b/src/Kconfig index 1eac469..6c8fe3e 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -259,6 +259,8 @@ designed to find out-of-bounds accesses. This feature consumes up to 1/8 of available memory and brings about ~1.5x performance slowdown. + (Before using this feature, make sure that asan_shadow_offset_callback + patch is applied to GCC.) If unsure, say N.
config RELOCATABLE_RAMSTAGE diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index cc8ac78..93d6ab1 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -9,7 +9,8 @@
ifeq ($(CONFIG_ASAN),y) ramstage-y += asan.c -CFLAGS_asan += -fsanitize=kernel-address \ +# Ensure that asan_shadow_offset_callback patch is applied to GCC before ASan is used. +CFLAGS_asan += -fsanitize=kernel-address --param asan-use-shadow-offset-callback=1 \ --param asan-stack=1 --param asan-globals=1 \ --param asan-instrumentation-with-call-threshold=0 CFLAGS_ramstage += $(CFLAGS_asan)