]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Aug 2018 07:20:48 +0000 (09:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Aug 2018 07:20:48 +0000 (09:20 +0200)
added patches:
kasan-add-no_sanitize-attribute-for-clang-builds.patch

queue-4.14/kasan-add-no_sanitize-attribute-for-clang-builds.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/kasan-add-no_sanitize-attribute-for-clang-builds.patch b/queue-4.14/kasan-add-no_sanitize-attribute-for-clang-builds.patch
new file mode 100644 (file)
index 0000000..da0a659
--- /dev/null
@@ -0,0 +1,55 @@
+From 12c8f25a016dff69ee284aa3338bebfd2cfcba33 Mon Sep 17 00:00:00 2001
+From: Andrey Konovalov <andreyknvl@google.com>
+Date: Fri, 20 Apr 2018 14:55:52 -0700
+Subject: kasan: add no_sanitize attribute for clang builds
+
+From: Andrey Konovalov <andreyknvl@google.com>
+
+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 <andreyknvl@google.com>
+Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
+Cc: Alexander Potapenko <glider@google.com>
+Cc: Dmitry Vyukov <dvyukov@google.com>
+Cc: David Rientjes <rientjes@google.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Ingo Molnar <mingo@kernel.org>
+Cc: David Woodhouse <dwmw@amazon.co.uk>
+Cc: Andrey Konovalov <andreyknvl@google.com>
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Paul Lawrence <paullawrence@google.com>
+Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
+Cc: Kees Cook <keescook@chromium.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Sodagudi Prasad <psodagud@codeaurora.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/compiler-clang.h |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/include/linux/compiler-clang.h
++++ b/include/linux/compiler-clang.h
+@@ -17,6 +17,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
index c0538569ff91ba2cdeaec61469a701868fcef36c..c008499a650b173c52bbbebb22bc6bfe0a418726 100644 (file)
@@ -3,3 +3,4 @@ parisc-define-mb-and-add-memory-barriers-to-assembler-unlock-sequences.patch
 scsi-hpsa-fix-selection-of-reply-queue.patch
 scsi-core-introduce-force_blk_mq.patch
 scsi-virtio_scsi-fix-io-hang-caused-by-automatic-irq-vector-affinity.patch
+kasan-add-no_sanitize-attribute-for-clang-builds.patch