aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/Kconfig
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2021-10-21 16:16:47 +0200
committerArd Biesheuvel <ardb@kernel.org>2021-12-03 15:11:30 +0100
commitf05eb1d24eb564488014d90b31824f71984d7ef5 (patch)
tree5912b4674c2d6e5dd7b82745702e8a39bad14290 /arch/arm/Kconfig
parentARM: decompressor: disable stack protector (diff)
downloadlinux-dev-f05eb1d24eb564488014d90b31824f71984d7ef5.tar.xz
linux-dev-f05eb1d24eb564488014d90b31824f71984d7ef5.zip
ARM: stackprotector: prefer compiler for TLS based per-task protector
Currently, we implement the per-task stack protector for ARM using a GCC plugin, due to lack of native compiler support. However, work is underway to get this implemented in the compiler, which means we will be able to deprecate the GCC plugin at some point. In the meantime, we will need to support both, where the native compiler implementation is obviously preferred. So let's wire this up in Kconfig and the Makefile. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Marc Zyngier <maz@kernel.org> Tested-by: Vladimir Murzin <vladimir.murzin@arm.com> # ARMv7M
Diffstat (limited to 'arch/arm/Kconfig')
-rw-r--r--arch/arm/Kconfig8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f0f9e8bec83a..4e301e4d2da6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1607,10 +1607,14 @@ config XEN
help
Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.
+config CC_HAVE_STACKPROTECTOR_TLS
+ def_bool $(cc-option,-mtp=cp15 -mstack-protector-guard=tls -mstack-protector-guard-offset=0)
+
config STACKPROTECTOR_PER_TASK
bool "Use a unique stack canary value for each task"
- depends on GCC_PLUGINS && STACKPROTECTOR && THREAD_INFO_IN_TASK && !XIP_DEFLATED_DATA
- select GCC_PLUGIN_ARM_SSP_PER_TASK
+ depends on STACKPROTECTOR && THREAD_INFO_IN_TASK && !XIP_DEFLATED_DATA
+ depends on GCC_PLUGINS || CC_HAVE_STACKPROTECTOR_TLS
+ select GCC_PLUGIN_ARM_SSP_PER_TASK if !CC_HAVE_STACKPROTECTOR_TLS
default y
help
Due to the fact that GCC uses an ordinary symbol reference from