summaryrefslogtreecommitdiff
path: root/arch/xtensa/kernel/entry.S
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-03-27 12:44:47 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2017-12-17 09:37:07 +0300
commit40d1a07b333ef1f7fce11ee20b8f4281d1a75fb9 (patch)
tree4855103872087025010742caa2ec0818f91f10ee /arch/xtensa/kernel/entry.S
parentaa6476f76c1678d5d1087b39d3047601f0139ef0 (diff)
downloadlinux-40d1a07b333ef1f7fce11ee20b8f4281d1a75fb9.tar.xz
xtensa: enable stack protector
The implementation is adopted from the ARM arch. GCC 7.3, 8 or newer is required for building the xtensa kernel with SSP. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/entry.S')
-rw-r--r--arch/xtensa/kernel/entry.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index a27a9a65635b..5caff0744f3c 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -1971,6 +1971,12 @@ ENTRY(_switch_to)
s32i a1, a2, THREAD_SP # save stack pointer
#endif
+#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
+ movi a6, __stack_chk_guard
+ l32i a8, a3, TASK_STACK_CANARY
+ s32i a8, a6, 0
+#endif
+
/* Disable ints while we manipulate the stack pointer. */
irq_save a14, a3