summaryrefslogtreecommitdiff
path: root/arch/s390/Kconfig
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2018-04-27 07:36:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-29 11:33:15 +0200
commitb609eb65f3158b986e7b80e4fa48665291a50564 (patch)
tree9c4376f7ace4143881bc03c52b458beccc45cdd1 /arch/s390/Kconfig
parent0bd4c47c20265763f280bddeabfc3e67b24a26f0 (diff)
downloadlinux-exynos-b609eb65f3158b986e7b80e4fa48665291a50564.tar.gz
linux-exynos-b609eb65f3158b986e7b80e4fa48665291a50564.tar.bz2
linux-exynos-b609eb65f3158b986e7b80e4fa48665291a50564.zip
s390: introduce execute-trampolines for branches
[ Upstream commit f19fbd5ed642dc31c809596412dab1ed56f2f156 ] Add CONFIG_EXPOLINE to enable the use of the new -mindirect-branch= and -mfunction_return= compiler options to create a kernel fortified against the specte v2 attack. With CONFIG_EXPOLINE=y all indirect branches will be issued with an execute type instruction. For z10 or newer the EXRL instruction will be used, for older machines the EX instruction. The typical indirect call basr %r14,%r1 is replaced with a PC relative call to a new thunk brasl %r14,__s390x_indirect_jump_r1 The thunk contains the EXRL/EX instruction to the indirect branch __s390x_indirect_jump_r1: exrl 0,0f j . 0: br %r1 The detour via the execute type instruction has a performance impact. To get rid of the detour the new kernel parameter "nospectre_v2" and "spectre_v2=[on,off,auto]" can be used. If the parameter is specified the kernel and module code will be patched at runtime. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/s390/Kconfig')
-rw-r--r--arch/s390/Kconfig28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 6fdcf4f90ab2..39cd1ed804a8 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -555,6 +555,34 @@ config KERNEL_NOBP
If unsure, say N.
+config EXPOLINE
+ def_bool n
+ prompt "Avoid speculative indirect branches in the kernel"
+ help
+ Compile the kernel with the expoline compiler options to guard
+ against kernel-to-user data leaks by avoiding speculative indirect
+ branches.
+ Requires a compiler with -mindirect-branch=thunk support for full
+ protection. The kernel may run slower.
+
+ If unsure, say N.
+
+choice
+ prompt "Expoline default"
+ depends on EXPOLINE
+ default EXPOLINE_FULL
+
+config EXPOLINE_OFF
+ bool "spectre_v2=off"
+
+config EXPOLINE_MEDIUM
+ bool "spectre_v2=auto"
+
+config EXPOLINE_FULL
+ bool "spectre_v2=on"
+
+endchoice
+
endmenu
menu "Memory setup"