]> Git Repo - linux.git/commitdiff
kasan: turn on -fsanitize-address-use-after-scope
authorAndrey Ryabinin <[email protected]>
Tue, 13 Dec 2016 00:44:59 +0000 (16:44 -0800)
committerLinus Torvalds <[email protected]>
Tue, 13 Dec 2016 02:55:09 +0000 (18:55 -0800)
In the upcoming gcc7 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.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrey Ryabinin <[email protected]>
Acked-by: Dmitry Vyukov <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
scripts/Makefile.kasan

index 37323b0df374b1a89fb256a4077165bc05376421..9576775a86f6418ac2ba6095b37f3e408c5cafca 100644 (file)
@@ -28,4 +28,6 @@ else
         CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
     endif
 endif
+
+CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope)
 endif
This page took 0.05406 seconds and 4 git commands to generate.