From: Greg Kroah-Hartman Date: Sat, 11 Aug 2018 17:12:59 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.18.1~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4999b84f0b1f391ba1a9533bd6f25db293e19c1c;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: kasan-turn-on-fsanitize-address-use-after-scope.patch --- diff --git a/queue-4.4/kasan-turn-on-fsanitize-address-use-after-scope.patch b/queue-4.4/kasan-turn-on-fsanitize-address-use-after-scope.patch new file mode 100644 index 00000000000..a9c0a58b5ef --- /dev/null +++ b/queue-4.4/kasan-turn-on-fsanitize-address-use-after-scope.patch @@ -0,0 +1,42 @@ +From c5caf21ab0cf884ef15b25af234f620e4a233139 Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin +Date: Mon, 12 Dec 2016 16:44:59 -0800 +Subject: kasan: turn on -fsanitize-address-use-after-scope + +From: Andrey Ryabinin + +commit c5caf21ab0cf884ef15b25af234f620e4a233139 upstream. + +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/1481207977-28654-1-git-send-email-aryabinin@virtuozzo.com +Signed-off-by: Andrey Ryabinin +Acked-by: Dmitry Vyukov +Cc: Alexander Potapenko +Cc: Andrey Konovalov +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: Nick Desaulniers +Signed-off-by: Greg Kroah-Hartman + +--- + scripts/Makefile.kasan | 2 ++ + 1 file changed, 2 insertions(+) + +--- 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 diff --git a/queue-4.4/series b/queue-4.4/series index 9e499bce787..05605533611 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -4,3 +4,4 @@ ipv4-ipv6-make-inet-_esp-select-crypto_echainiv.patch fork-unconditionally-clear-stack-on-fork.patch parisc-enable-config_mlongcalls-by-default.patch parisc-define-mb-and-add-memory-barriers-to-assembler-unlock-sequences.patch +kasan-turn-on-fsanitize-address-use-after-scope.patch