From: Greg Kroah-Hartman Date: Sat, 11 Aug 2018 07:21:07 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.18.1~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=957f0ac09974727dd212330791a0745a2a22661f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: kasan-add-no_sanitize-attribute-for-clang-builds.patch --- diff --git a/queue-4.9/kasan-add-no_sanitize-attribute-for-clang-builds.patch b/queue-4.9/kasan-add-no_sanitize-attribute-for-clang-builds.patch new file mode 100644 index 00000000000..360015c2ad1 --- /dev/null +++ b/queue-4.9/kasan-add-no_sanitize-attribute-for-clang-builds.patch @@ -0,0 +1,55 @@ +From 12c8f25a016dff69ee284aa3338bebfd2cfcba33 Mon Sep 17 00:00:00 2001 +From: Andrey Konovalov +Date: Fri, 20 Apr 2018 14:55:52 -0700 +Subject: kasan: add no_sanitize attribute for clang builds + +From: Andrey Konovalov + +commit 12c8f25a016dff69ee284aa3338bebfd2cfcba33 upstream. + +KASAN uses the __no_sanitize_address macro to disable instrumentation of +particular functions. Right now it's defined only for GCC build, which +causes false positives when clang is used. + +This patch adds a definition for clang. + +Note, that clang's revision 329612 or higher is required. + +[andreyknvl@google.com: remove redundant #ifdef CONFIG_KASAN check] + Link: http://lkml.kernel.org/r/c79aa31a2a2790f6131ed607c58b0dd45dd62a6c.1523967959.git.andreyknvl@google.com +Link: http://lkml.kernel.org/r/4ad725cc903f8534f8c8a60f0daade5e3d674f8d.1523554166.git.andreyknvl@google.com +Signed-off-by: Andrey Konovalov +Acked-by: Andrey Ryabinin +Cc: Alexander Potapenko +Cc: Dmitry Vyukov +Cc: David Rientjes +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: David Woodhouse +Cc: Andrey Konovalov +Cc: Will Deacon +Cc: Greg Kroah-Hartman +Cc: Paul Lawrence +Cc: Sandipan Das +Cc: Kees Cook +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Cc: Sodagudi Prasad +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/compiler-clang.h | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/include/linux/compiler-clang.h ++++ b/include/linux/compiler-clang.h +@@ -16,6 +16,9 @@ + */ + #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) + ++#undef __no_sanitize_address ++#define __no_sanitize_address __attribute__((no_sanitize("address"))) ++ + /* Clang doesn't have a way to turn it off per-function, yet. */ + #ifdef __noretpoline + #undef __noretpoline diff --git a/queue-4.9/series b/queue-4.9/series index 0a33f24af49..2ca2711a04b 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -2,3 +2,4 @@ ext4-fix-check-to-prevent-initializing-reserved-inodes.patch tpm-fix-race-condition-in-tpm_common_write.patch parisc-enable-config_mlongcalls-by-default.patch parisc-define-mb-and-add-memory-barriers-to-assembler-unlock-sequences.patch +kasan-add-no_sanitize-attribute-for-clang-builds.patch