mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
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>
This commit is contained in:
committed by
Martin Schwidefsky
parent
d58106c3ec
commit
dde709d136
@@ -208,6 +208,12 @@
|
|||||||
* Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
|
* Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
|
||||||
*/
|
*/
|
||||||
#define __no_sanitize_address __attribute__((no_sanitize_address))
|
#define __no_sanitize_address __attribute__((no_sanitize_address))
|
||||||
|
#ifdef CONFIG_KASAN
|
||||||
|
#define __no_sanitize_address_or_inline \
|
||||||
|
__no_sanitize_address __maybe_unused notrace
|
||||||
|
#else
|
||||||
|
#define __no_sanitize_address_or_inline inline
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GCC_VERSION >= 50100
|
#if GCC_VERSION >= 50100
|
||||||
@@ -225,6 +231,7 @@
|
|||||||
|
|
||||||
#if !defined(__no_sanitize_address)
|
#if !defined(__no_sanitize_address)
|
||||||
#define __no_sanitize_address
|
#define __no_sanitize_address
|
||||||
|
#define __no_sanitize_address_or_inline inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user