History

arm64: Add gcc Shadow Call Stack support

Shadow call stacks will be available in GCC >= 12, this patch makes the corresponding kernel configuration available when compiling the kernel with the gcc. Note that the implementation in GCC is slightly different from Clang. With SCS enabled, functions will only pop x30 once in the epilogue, like: str x30, [x18], #8 stp x29, x30, [sp, #-16]! ...... - ldp x29, x30, [sp], #16 //clang + ldr x29, [sp], #16 //GCC ldr x30, [x18, #-8]! Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ce09ab17ddd21f73ff2caf6eec3b0ee9b0e1a11e

Dan Li committed 4 years ago

Commit afcf5441 parent 575d6b73 files · +15 −10Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/linux/compiler-gcc.h+4−0
@@ -97,6 +97,10 @@ · 96 unmodified lines
97#define KASAN_ABI_VERSION 497#define KASAN_ABI_VERSION 4
98#endif98#endif
99 99
100#ifdef CONFIG_SHADOW_CALL_STACK
101#define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
102#endif
103
100#if __has_attribute(__no_sanitize_address__)104#if __has_attribute(__no_sanitize_address__)
101#define __no_sanitize_address __attribute__((no_sanitize_address))105#define __no_sanitize_address __attribute__((no_sanitize_address))
102#else106#else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t