summaryrefslogtreecommitdiff
path: root/include/linux/stackprotector.h
diff options
context:
space:
mode:
authorAmit Daniel Kachhap <amit.kachhap@arm.com>2020-03-13 14:34:57 +0530
committerCatalin Marinas <catalin.marinas@arm.com>2020-03-18 09:50:20 +0000
commit28321582334c261c13b20d7efe634e610b4c100b (patch)
tree1a345f68e800b30309c0b710048d97dea3aecf16 /include/linux/stackprotector.h
parent33e45234987ea3ed4b05fc512f4441696478f12d (diff)
arm64: initialize ptrauth keys for kernel booting task
This patch uses the existing boot_init_stack_canary arch function to initialize the ptrauth keys for the booting task in the primary core. The requirement here is that it should be always inline and the caller must never return. As pointer authentication too detects a subset of stack corruption so it makes sense to place this code here. Both pointer authentication and stack canary codes are protected by their respective config option. Suggested-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> Reviewed-by: Vincenzo Frascino <Vincenzo.Frascino@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'include/linux/stackprotector.h')
-rw-r--r--include/linux/stackprotector.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/stackprotector.h b/include/linux/stackprotector.h
index 6b792d080eee..4c678c4fec58 100644
--- a/include/linux/stackprotector.h
+++ b/include/linux/stackprotector.h
@@ -6,7 +6,7 @@
#include <linux/sched.h>
#include <linux/random.h>
-#ifdef CONFIG_STACKPROTECTOR
+#if defined(CONFIG_STACKPROTECTOR) || defined(CONFIG_ARM64_PTR_AUTH)
# include <asm/stackprotector.h>
#else
static inline void boot_init_stack_canary(void)