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>
Unified · Split
| @@ -25,6 +25,9 @@ · 24 unmodified lines | |||
| 25 | #define __SANITIZE_ADDRESS__ | 25 | #define __SANITIZE_ADDRESS__ |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | #undef __no_sanitize_address | ||
| 29 | #define __no_sanitize_address __attribute__((no_sanitize("address"))) | ||
| 30 | |||
| 28 | /* Clang doesn't have a way to turn it off per-function, yet. */ | 31 | /* Clang doesn't have a way to turn it off per-function, yet. */ |
| 29 | #ifdef __noretpoline | 32 | #ifdef __noretpoline |
| 30 | #undef __noretpoline | 33 | #undef __noretpoline |