Commit 163c8d54 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Linus Torvalds

compiler: remove __no_sanitize_address_or_inline again

The __no_sanitize_address_or_inline and __no_kasan_or_inline defines
are almost identical. The only difference is that __no_kasan_or_inline
does not have the 'notrace' attribute.

To be able to replace __no_sanitize_address_or_inline with the older
definition, add 'notrace' to __no_kasan_or_inline and change to two
users of __no_sanitize_address_or_inline in the s390 code.

The 'notrace' option is necessary for e.g. the __load_psw_mask function
in arch/s390/include/asm/processor.h. Without the option it is possible
to trace __load_psw_mask which leads to kernel stack overflow.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Pointed-out-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 65102238
......@@ -236,7 +236,7 @@ static inline unsigned long current_stack_pointer(void)
return sp;
}
static __no_sanitize_address_or_inline unsigned short stap(void)
static __no_kasan_or_inline unsigned short stap(void)
{
unsigned short cpu_address;
......@@ -330,7 +330,7 @@ static inline void __load_psw(psw_t psw)
* Set PSW mask to specified value, while leaving the
* PSW addr pointing to the next instruction.
*/
static __no_sanitize_address_or_inline void __load_psw_mask(unsigned long mask)
static __no_kasan_or_inline void __load_psw_mask(unsigned long mask)
{
unsigned long addr;
psw_t psw;
......
......@@ -143,18 +143,6 @@
#define KASAN_ABI_VERSION 3
#endif
/*
* Because __no_sanitize_address conflicts with inlining:
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
* we do one or the other.
*/
#ifdef CONFIG_KASAN
#define __no_sanitize_address_or_inline \
__no_sanitize_address __maybe_unused notrace
#else
#define __no_sanitize_address_or_inline inline
#endif
#if GCC_VERSION >= 50100
#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
#endif
......
......@@ -189,7 +189,7 @@ void __read_once_size(const volatile void *p, void *res, int size)
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
* '__maybe_unused' allows us to avoid defined-but-not-used warnings.
*/
# define __no_kasan_or_inline __no_sanitize_address __maybe_unused
# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused
#else
# define __no_kasan_or_inline __always_inline
#endif
......
Markdown is supported
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