lkml.org 
[lkml]   [2016]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kasan: turn on -fsanitize-address-use-after-scope
Date
In the upcoming gcc7 release release, the -fsanitize=kernel-address option
at first implied new -fsanitize-address-use-after-scope option.
This would cause link errors on older kernels because they don't have
two new functions required for use-after-scope support. Therefore,
gcc7 changed default to -fno-sanitize-address-use-after-scope.

Now the kernel has everything required for that feature since
commit 828347f8f9a5 ("kasan: support use-after-scope detection").
So, to make it work, we just have to enable use-after-scope in CFLAGS.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
scripts/Makefile.kasan | 2 ++
1 file changed, 2 insertions(+)

diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
index 37323b0..9576775 100644
--- a/scripts/Makefile.kasan
+++ b/scripts/Makefile.kasan
@@ -28,4 +28,6 @@ else
CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
endif
endif
+
+CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
endif
--
2.7.3
\
 
 \ /
  Last update: 2016-12-08 15:22    [W:0.039 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site