[lkml]   [2017]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 38/43] x86/mm/kaiser: Disable native VSYSCALL
From: Dave Hansen <>

The KAISER code attempts to "poison" the user portion of the kernel page
tables. It detects entries that it wants that it wants to poison in two
* Looking for addresses >= PAGE_OFFSET
* Looking for entries without _PAGE_USER set

But, to allow the _PAGE_USER check to work, it must never be set on
init_mm entries, and an earlier patch in this series ensured that it
will never be set.

The VDSO is at a address >= PAGE_OFFSET and it is also mapped by init_mm.
Because of the earlier, KAISER-enforced restriction, _PAGE_USER is never
set which makes the VDSO unreadable to userspace.

This makes the "NATIVE" case totally unusable since userspace can not
even see the memory any more. Disable it whenever KAISER is enabled.

Also add some help text about how KAISER might affect the emulation
case as well.

Signed-off-by: Dave Hansen <>
Cc: Andy Lutomirski <>
Cc: Borislav Petkov <>
Cc: Brian Gerst <>
Cc: Daniel Gruss <>
Cc: Denys Vlasenko <>
Cc: H. Peter Anvin <>
Cc: Hugh Dickins <>
Cc: Josh Poimboeuf <>
Cc: Kees Cook <>
Cc: Linus Torvalds <>
Cc: Michael Schwarz <>
Cc: Moritz Lipp <>
Cc: Peter Zijlstra <>
Cc: Richard Fellner <>
Cc: Thomas Gleixner <>
Signed-off-by: Ingo Molnar <>
arch/x86/Kconfig | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 09dcc94c4484..d23cd2902b10 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2249,6 +2249,9 @@ choice

bool "Native"
+ # The VSYSCALL page comes from the kernel page tables
+ # and is not available when KAISER is enabled.
+ depends on ! KAISER
Actual executable code is located in the fixed vsyscall
address mapping, implementing time() efficiently. Since
@@ -2266,6 +2269,11 @@ choice
exploits. This configuration is recommended when userspace
still uses the vsyscall area.

+ When KAISER is enabled, the vsyscall area will become
+ unreadable. This emulation option still works, but KAISER
+ will make it harder to do things like trace code using the
+ emulation.
bool "None"
 \ /
  Last update: 2017-11-24 10:18    [W:0.217 / U:4.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site