Commit 12c8f25a authored by Andrey Konovalov's avatar Andrey Konovalov Committed by Linus Torvalds
Browse files

kasan: add no_sanitize attribute for clang builds

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.

[ remove redundant #ifdef CONFIG_KASAN check]

Signed-off-by: default avatarAndrey Konovalov <>
Acked-by: default avatarAndrey 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: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent c5157b76
......@@ -25,6 +25,9 @@
#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
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