aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/compiler-clang.h
diff options
context:
space:
mode:
authorMarco Elver <elver@google.com>2020-06-04 07:58:11 +0200
committerPeter Zijlstra <peterz@infradead.org>2020-06-15 14:10:09 +0200
commit5144f8a8dfd7b3681f0a2b5bf599a210b2315018 (patch)
tree6fd894145f691c9d671cc29291b19c0dcc5558d1 /include/linux/compiler-clang.h
parentkasan: Bump required compiler version (diff)
downloadwireguard-linux-5144f8a8dfd7b3681f0a2b5bf599a210b2315018.tar.xz
wireguard-linux-5144f8a8dfd7b3681f0a2b5bf599a210b2315018.zip
compiler_types.h: Add __no_sanitize_{address,undefined} to noinstr
Adds the portable definitions for __no_sanitize_address, and __no_sanitize_undefined, and subsequently changes noinstr to use the attributes to disable instrumentation via KASAN or UBSAN. Reported-by: syzbot+dc1fa714cb070b184db5@syzkaller.appspotmail.com Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> Link: https://lore.kernel.org/lkml/000000000000d2474c05a6c938fe@google.com/
Diffstat (limited to 'include/linux/compiler-clang.h')
-rw-r--r--include/linux/compiler-clang.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index ee37256ec8bd..5e55302e3bf6 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -33,6 +33,14 @@
#define __no_sanitize_thread
#endif
+#if __has_feature(undefined_behavior_sanitizer)
+/* GCC does not have __SANITIZE_UNDEFINED__ */
+#define __no_sanitize_undefined \
+ __attribute__((no_sanitize("undefined")))
+#else
+#define __no_sanitize_undefined
+#endif
+
/*
* Not all versions of clang implement the the type-generic versions
* of the builtin overflow checkers. Fortunately, clang implements