summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/stackprotector.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-12-12 13:08:44 +0100
committerWill Deacon <will.deacon@arm.com>2018-12-12 18:45:31 +0000
commit0a1213fa7432778b71a1c0166bf56660a3aab030 (patch)
treeddf7b68d14a504fe97fbdefe00bf8a3296590cc5 /arch/arm64/include/asm/stackprotector.h
parent4ab215061554ae2a4b78744a5dd3b3c6639f16a7 (diff)
arm64: enable per-task stack canaries
This enables the use of per-task stack canary values if GCC has support for emitting the stack canary reference relative to the value of sp_el0, which holds the task struct pointer in the arm64 kernel. The $(eval) extends KBUILD_CFLAGS at the moment the make rule is applied, which means asm-offsets.o (which we rely on for the offset value) is built without the arguments, and everything built afterwards has the options set. Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/stackprotector.h')
-rw-r--r--arch/arm64/include/asm/stackprotector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/stackprotector.h b/arch/arm64/include/asm/stackprotector.h
index 58d15be11c4d..5884a2b02827 100644
--- a/arch/arm64/include/asm/stackprotector.h
+++ b/arch/arm64/include/asm/stackprotector.h
@@ -34,7 +34,8 @@ static __always_inline void boot_init_stack_canary(void)
canary &= CANARY_MASK;
current->stack_canary = canary;
- __stack_chk_guard = current->stack_canary;
+ if (!IS_ENABLED(CONFIG_STACKPROTECTOR_PER_TASK))
+ __stack_chk_guard = current->stack_canary;
}
#endif /* _ASM_STACKPROTECTOR_H */