[lkml]   [2017]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 23/23] x86, kaiser: add Kconfig

PARAVIRT generally requires that the kernel not manage its own page
tables. It also means that the hypervisor and kernel must agree
wholeheartedly about what format the page tables are in and what
they contain. KAISER, unfortunately, changes the rules and they
can not be used together.

I've seen conflicting feedback from maintainers lately about whether
they want the Kconfig magic to go first or last in a patch series.
It's going last here because the partially-applied series leads to
kernels that can not boot in a bunch of cases. I did a run through
the entire series with CONFIG_KAISER=y to look for build errors,

Note from Hugh Dickins on why it depends on SMP:

It is absurd that KAISER should depend on SMP, but
apparently nobody has tried a UP build before: which
breaks on implicit declaration of function
'per_cpu_offset' in arch/x86/mm/kaiser.c.

Now, you would expect that to be trivially fixed up; but
looking at the when that block is #ifdef'ed
out of kaiser_init(), I see that in a UP build
__per_cpu_user_mapped_end is precisely at
__per_cpu_user_mapped_start, and the items carefully
gathered into that section for user-mapping on SMP,
dispersed elsewhere on UP.

Signed-off-by: Dave Hansen <>
Cc: Moritz Lipp <>
Cc: Daniel Gruss <>
Cc: Michael Schwarz <>
Cc: Andy Lutomirski <>
Cc: Linus Torvalds <>
Cc: Kees Cook <>
Cc: Hugh Dickins <>

b/security/Kconfig | 10 ++++++++++
1 file changed, 10 insertions(+)

diff -puN security/Kconfig~kaiser-kconfig security/Kconfig
--- a/security/Kconfig~kaiser-kconfig 2017-10-31 15:04:01.680648908 -0700
+++ b/security/Kconfig 2017-10-31 15:04:01.684649097 -0700
@@ -54,6 +54,16 @@ config SECURITY_NETWORK
implement socket and networking access controls.
If you are unsure how to answer this question, answer N.

+config KAISER
+ bool "Remove the kernel mapping in user mode"
+ depends on X86_64 && SMP && !PARAVIRT
+ help
+ This feature reduces the number of hardware side channels by
+ ensuring that the majority of kernel addresses are not mapped
+ into userspace.
+ See Documentation/x86/kaiser.txt for more details.
bool "Infiniband Security Hooks"
 \ /
  Last update: 2017-10-31 23:33    [W:0.349 / U:4.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site