Skip to content

Commit 163c8d5

Browse files
Martin Schwidefskytorvalds
authored andcommitted
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: Martin Schwidefsky <schwidefsky@de.ibm.com> Pointed-out-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6510223 commit 163c8d5

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

arch/s390/include/asm/processor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static inline unsigned long current_stack_pointer(void)
236236
return sp;
237237
}
238238

239-
static __no_sanitize_address_or_inline unsigned short stap(void)
239+
static __no_kasan_or_inline unsigned short stap(void)
240240
{
241241
unsigned short cpu_address;
242242

@@ -330,7 +330,7 @@ static inline void __load_psw(psw_t psw)
330330
* Set PSW mask to specified value, while leaving the
331331
* PSW addr pointing to the next instruction.
332332
*/
333-
static __no_sanitize_address_or_inline void __load_psw_mask(unsigned long mask)
333+
static __no_kasan_or_inline void __load_psw_mask(unsigned long mask)
334334
{
335335
unsigned long addr;
336336
psw_t psw;

include/linux/compiler-gcc.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,6 @@
143143
#define KASAN_ABI_VERSION 3
144144
#endif
145145

146-
/*
147-
* Because __no_sanitize_address conflicts with inlining:
148-
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
149-
* we do one or the other.
150-
*/
151-
#ifdef CONFIG_KASAN
152-
#define __no_sanitize_address_or_inline \
153-
__no_sanitize_address __maybe_unused notrace
154-
#else
155-
#define __no_sanitize_address_or_inline inline
156-
#endif
157-
158146
#if GCC_VERSION >= 50100
159147
#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
160148
#endif

include/linux/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void __read_once_size(const volatile void *p, void *res, int size)
189189
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
190190
* '__maybe_unused' allows us to avoid defined-but-not-used warnings.
191191
*/
192-
# define __no_kasan_or_inline __no_sanitize_address __maybe_unused
192+
# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused
193193
#else
194194
# define __no_kasan_or_inline __always_inline
195195
#endif

0 commit comments

Comments
 (0)