diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2017-11-20 05:16:14 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-09 05:21:25 -0400 |
commit | dde709d1361ab50d3b9f2824f72b4374f5582e84 (patch) | |
tree | 441e7bde41fc063c7f23f31578560ca6174d6f16 /include/linux/compiler-gcc.h | |
parent | d58106c3ec9abcf2f9882171d6230eccfd6dc52e (diff) |
compiler: introduce __no_sanitize_address_or_inline
Due to conflict between kasan instrumentation and inlining
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 functions which are
defined as inline could not be called from functions defined with
__no_sanitize_address.
Introduce __no_sanitize_address_or_inline which would expand to
__no_sanitize_address when the kernel is built with kasan support and
to inline otherwise. This helps to avoid disabling kasan
instrumentation for entire files.
Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r-- | include/linux/compiler-gcc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 763bbad1e258..997ade08a79d 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -208,6 +208,12 @@ | |||
208 | * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 | 208 | * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 |
209 | */ | 209 | */ |
210 | #define __no_sanitize_address __attribute__((no_sanitize_address)) | 210 | #define __no_sanitize_address __attribute__((no_sanitize_address)) |
211 | #ifdef CONFIG_KASAN | ||
212 | #define __no_sanitize_address_or_inline \ | ||
213 | __no_sanitize_address __maybe_unused notrace | ||
214 | #else | ||
215 | #define __no_sanitize_address_or_inline inline | ||
216 | #endif | ||
211 | #endif | 217 | #endif |
212 | 218 | ||
213 | #if GCC_VERSION >= 50100 | 219 | #if GCC_VERSION >= 50100 |
@@ -225,6 +231,7 @@ | |||
225 | 231 | ||
226 | #if !defined(__no_sanitize_address) | 232 | #if !defined(__no_sanitize_address) |
227 | #define __no_sanitize_address | 233 | #define __no_sanitize_address |
234 | #define __no_sanitize_address_or_inline inline | ||
228 | #endif | 235 | #endif |
229 | 236 | ||
230 | /* | 237 | /* |