]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0214-x86-mm-pti-Add-Kconfig.patch
KPTI: add follow-up fixes
[pve-kernel.git] / patches / kernel / 0214-x86-mm-pti-Add-Kconfig.patch
CommitLineData
321d628a
FG
1From 0692cf84257a92f7be9553af55d65c668e2b3bc8 Mon Sep 17 00:00:00 2001
2From: Dave Hansen <dave.hansen@linux.intel.com>
3Date: Mon, 4 Dec 2017 15:08:03 +0100
e4cdf2a5 4Subject: [PATCH 214/241] x86/mm/pti: Add Kconfig
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11Finally allow CONFIG_PAGE_TABLE_ISOLATION to be enabled.
12
13PARAVIRT generally requires that the kernel not manage its own page tables.
14It also means that the hypervisor and kernel must agree wholeheartedly
15about what format the page tables are in and what they contain.
16PAGE_TABLE_ISOLATION, unfortunately, changes the rules and they
17can not be used together.
18
19I've seen conflicting feedback from maintainers lately about whether they
20want the Kconfig magic to go first or last in a patch series. It's going
21last here because the partially-applied series leads to kernels that can
22not boot in a bunch of cases. I did a run through the entire series with
23CONFIG_PAGE_TABLE_ISOLATION=y to look for build errors, though.
24
25[ tglx: Removed SMP and !PARAVIRT dependencies as they not longer exist ]
26
27Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
28Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
29Cc: Andy Lutomirski <luto@kernel.org>
30Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
31Cc: Borislav Petkov <bp@alien8.de>
32Cc: Brian Gerst <brgerst@gmail.com>
33Cc: David Laight <David.Laight@aculab.com>
34Cc: Denys Vlasenko <dvlasenk@redhat.com>
35Cc: Eduardo Valentin <eduval@amazon.com>
36Cc: Greg KH <gregkh@linuxfoundation.org>
37Cc: H. Peter Anvin <hpa@zytor.com>
38Cc: Josh Poimboeuf <jpoimboe@redhat.com>
39Cc: Juergen Gross <jgross@suse.com>
40Cc: Linus Torvalds <torvalds@linux-foundation.org>
41Cc: Peter Zijlstra <peterz@infradead.org>
42Cc: Will Deacon <will.deacon@arm.com>
43Cc: aliguori@amazon.com
44Cc: daniel.gruss@iaik.tugraz.at
45Cc: hughd@google.com
46Cc: keescook@google.com
47Cc: linux-mm@kvack.org
48Signed-off-by: Ingo Molnar <mingo@kernel.org>
49(cherry picked from commit 385ce0ea4c078517fa51c261882c4e72fba53005)
50Signed-off-by: Andy Whitcroft <apw@canonical.com>
51Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
52(cherry picked from commit ce12963b837e809f6ae048587d9377a298c1094d)
53Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
54---
55 security/Kconfig | 10 ++++++++++
56 1 file changed, 10 insertions(+)
57
58diff --git a/security/Kconfig b/security/Kconfig
59index 305b496ff6a3..91cb8f611a0d 100644
60--- a/security/Kconfig
61+++ b/security/Kconfig
62@@ -96,6 +96,16 @@ config SECURITY_NETWORK
63 implement socket and networking access controls.
64 If you are unsure how to answer this question, answer N.
65
66+config PAGE_TABLE_ISOLATION
67+ bool "Remove the kernel mapping in user mode"
68+ depends on X86_64 && !UML
69+ help
70+ This feature reduces the number of hardware side channels by
71+ ensuring that the majority of kernel addresses are not mapped
72+ into userspace.
73+
74+ See Documentation/x86/pagetable-isolation.txt for more details.
75+
76 config SECURITY_INFINIBAND
77 bool "Infiniband Security Hooks"
78 depends on SECURITY && INFINIBAND
79--
802.14.2
81