Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ab02b6a authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Alistair Delva
Browse files

BACKPORT: compiler: remove __no_sanitize_address_or_inline again



(Upstream commit 163c8d54a997153ee1a1e07fcac087492ad85b37).

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>
Change-Id: I27af631729f8ea52e55f31c02f584c01a0918073
Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Bug: 128674696
parent 52023a31
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -183,21 +183,6 @@
#define KASAN_ABI_VERSION 3
#endif

#if GCC_VERSION >= 40902
/*
 * Tell the compiler that address safety instrumentation (KASAN)
 * should not be applied to that function.
 * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
 */
#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

#if GCC_VERSION >= 50100
/*
 * Mark structures as requiring designated initializers.
@@ -217,7 +202,6 @@

#if !defined(__no_sanitize_address)
#define __no_sanitize_address
#define __no_sanitize_address_or_inline inline
#endif

/*
+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,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