Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682749 > unrolled thread

[PATCH 4/4] kasan: add compiler support for clang

Started byGreg Hackmann <ghackmann@google.com>
First post2017-07-07 00:10 +0200
Last post2017-07-10 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/4] kasan: add compiler support for clang Greg Hackmann <ghackmann@google.com> - 2017-07-07 00:10 +0200
    Re: [PATCH 4/4] kasan: add compiler support for clang Dmitry Vyukov <dvyukov@google.com> - 2017-07-10 10:50 +0200

#1682749 — [PATCH 4/4] kasan: add compiler support for clang

FromGreg Hackmann <ghackmann@google.com>
Date2017-07-07 00:10 +0200
Subject[PATCH 4/4] kasan: add compiler support for clang
Message-ID<u0n8e-3bI-17@gated-at.bofh.it>
For now we can hard-code ASAN ABI level 5, since historical clang builds
can't build the kernel anyway.  We also need to emulate gcc's
__SANITIZE_ADDRESS__ flag, or memset() calls won't be instrumented.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
---
 include/linux/compiler-clang.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index d614c5ea1b5e..8153f793b22a 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -23,3 +23,13 @@
  */
 #undef inline
 #define inline inline __attribute__((unused)) notrace
+
+/* all clang versions usable with the kernel support KASAN ABI version 5
+ */
+#define KASAN_ABI_VERSION 5
+
+/* emulate gcc's __SANITIZE_ADDRESS__ flag
+ */
+#if __has_feature(address_sanitizer)
+#define __SANITIZE_ADDRESS__
+#endif
-- 
2.13.2.725.g09c95d1e9-goog

[toc] | [next] | [standalone]


#1684053

FromDmitry Vyukov <dvyukov@google.com>
Date2017-07-10 10:50 +0200
Message-ID<u1Cyd-2Hm-3@gated-at.bofh.it>
In reply to#1682749
On Fri, Jul 7, 2017 at 12:01 AM, Greg Hackmann <ghackmann@google.com> wrote:
> For now we can hard-code ASAN ABI level 5, since historical clang builds
> can't build the kernel anyway.  We also need to emulate gcc's
> __SANITIZE_ADDRESS__ flag, or memset() calls won't be instrumented.
>
> Signed-off-by: Greg Hackmann <ghackmann@google.com>
> ---
>  include/linux/compiler-clang.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
> index d614c5ea1b5e..8153f793b22a 100644
> --- a/include/linux/compiler-clang.h
> +++ b/include/linux/compiler-clang.h
> @@ -23,3 +23,13 @@
>   */
>  #undef inline
>  #define inline inline __attribute__((unused)) notrace
> +
> +/* all clang versions usable with the kernel support KASAN ABI version 5
> + */
> +#define KASAN_ABI_VERSION 5
> +
> +/* emulate gcc's __SANITIZE_ADDRESS__ flag
> + */
> +#if __has_feature(address_sanitizer)
> +#define __SANITIZE_ADDRESS__
> +#endif


Reviewed-by: Dmitry Vyukov <dvyukov@google.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web