Commit 53a98ed7 authored by Paul Lawrence's avatar Paul Lawrence Committed by Linus Torvalds
Browse files

kasan: add compiler support for clang

Patch series "kasan: support alloca, LLVM", v4.

This patch (of 5):

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: default avatarGreg Hackmann <>
Signed-off-by: default avatarPaul Lawrence <>
Acked-by: default avatarAndrey Ryabinin <>
Cc: Alexander Potapenko <>
Cc: Dmitry Vyukov <>
Cc: Masahiro Yamada <>
Cc: Matthias Kaehlcke <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 0e410e15
......@@ -19,3 +19,11 @@
#define randomized_struct_fields_start struct {
#define randomized_struct_fields_end };
/* all clang versions usable with the kernel support KASAN ABI version 5 */
/* emulate gcc's __SANITIZE_ADDRESS__ flag */
#if __has_feature(address_sanitizer)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment