Skip to content

Commit 7375ae3

Browse files
tlendackyIngo Molnar
authored andcommitted
compiler-gcc.h: Introduce __nostackprotector function attribute
Create a new function attribute, __nostackprotector, that can used to turn off stack protection on a per function basis. Signed-off-by: Tom Lendacky <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brijesh Singh <[email protected]> Cc: Dave Young <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Larry Woodman <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Michael S. Tsirkin <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Radim Krčmář <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Toshimitsu Kani <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/0576fd5c74440ad0250f16ac6609ecf587812456.1500319216.git.thomas.lendacky@amd.com Signed-off-by: Ingo Molnar <[email protected]>
1 parent e505371 commit 7375ae3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/linux/compiler-gcc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@
166166

167167
#if GCC_VERSION >= 40100
168168
# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
169+
170+
#define __nostackprotector __attribute__((__optimize__("no-stack-protector")))
169171
#endif
170172

171173
#if GCC_VERSION >= 40300

include/linux/compiler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
470470
#define __visible
471471
#endif
472472

473+
#ifndef __nostackprotector
474+
# define __nostackprotector
475+
#endif
476+
473477
/*
474478
* Assume alignment of return value.
475479
*/

0 commit comments

Comments
 (0)