diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2020-04-27 18:00:16 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-05-15 17:35:50 +0200 |
commit | 5287569a790d2546a06db07e391bf84b8bd6cf51 (patch) | |
tree | 137dc42c9e15afc1b7880798d2ea1ed146301211 /arch/arm64/include/asm/thread_info.h | |
parent | arm64: Disable SCS for hypervisor code (diff) | |
download | linux-5287569a790d2546a06db07e391bf84b8bd6cf51.tar.xz linux-5287569a790d2546a06db07e391bf84b8bd6cf51.zip |
arm64: Implement Shadow Call Stack
This change implements shadow stack switching, initial SCS set-up,
and interrupt shadow stacks for arm64.
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/thread_info.h')
-rw-r--r-- | arch/arm64/include/asm/thread_info.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 512174a8e789..9df79c0a4c43 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -41,6 +41,10 @@ struct thread_info { #endif } preempt; }; +#ifdef CONFIG_SHADOW_CALL_STACK + void *scs_base; + unsigned long scs_offset; +#endif }; #define thread_saved_pc(tsk) \ @@ -100,11 +104,20 @@ void arch_release_task_struct(struct task_struct *tsk); _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ _TIF_SYSCALL_EMU) +#ifdef CONFIG_SHADOW_CALL_STACK +#define INIT_SCS \ + .scs_base = init_shadow_call_stack, \ + .scs_offset = 0, +#else +#define INIT_SCS +#endif + #define INIT_THREAD_INFO(tsk) \ { \ .flags = _TIF_FOREIGN_FPSTATE, \ .preempt_count = INIT_PREEMPT_COUNT, \ .addr_limit = KERNEL_DS, \ + INIT_SCS \ } #endif /* __ASM_THREAD_INFO_H */ |