]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0199-x86-entry-Align-entry-text-section-to-PMD-boundary.patch
KPTI: add follow-up fixes
[pve-kernel.git] / patches / kernel / 0199-x86-entry-Align-entry-text-section-to-PMD-boundary.patch
CommitLineData
321d628a
FG
1From 1b3d3968bb45b557ce76eaf3edf894aead9e9c03 Mon Sep 17 00:00:00 2001
2From: Thomas Gleixner <tglx@linutronix.de>
3Date: Mon, 4 Dec 2017 15:07:46 +0100
e4cdf2a5 4Subject: [PATCH 199/241] x86/entry: Align entry text section to PMD boundary
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11The (irq)entry text must be visible in the user space page tables. To allow
12simple PMD based sharing, make the entry text PMD aligned.
13
14Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15Cc: Andy Lutomirski <luto@kernel.org>
16Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
17Cc: Borislav Petkov <bp@alien8.de>
18Cc: Brian Gerst <brgerst@gmail.com>
19Cc: Dave Hansen <dave.hansen@linux.intel.com>
20Cc: David Laight <David.Laight@aculab.com>
21Cc: Denys Vlasenko <dvlasenk@redhat.com>
22Cc: Eduardo Valentin <eduval@amazon.com>
23Cc: Greg KH <gregkh@linuxfoundation.org>
24Cc: H. Peter Anvin <hpa@zytor.com>
25Cc: Josh Poimboeuf <jpoimboe@redhat.com>
26Cc: Juergen Gross <jgross@suse.com>
27Cc: Linus Torvalds <torvalds@linux-foundation.org>
28Cc: Peter Zijlstra <peterz@infradead.org>
29Cc: Will Deacon <will.deacon@arm.com>
30Cc: aliguori@amazon.com
31Cc: daniel.gruss@iaik.tugraz.at
32Cc: hughd@google.com
33Cc: keescook@google.com
34Signed-off-by: Ingo Molnar <mingo@kernel.org>
35(cherry picked from commit 2f7412ba9c6af5ab16bdbb4a3fdb1dcd2b4fd3c2)
36Signed-off-by: Andy Whitcroft <apw@canonical.com>
37Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
38(cherry picked from commit 3cf72b14b56834882ebe731d5fa84d249c56a188)
39Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
40---
41 arch/x86/kernel/vmlinux.lds.S | 8 ++++++++
42 1 file changed, 8 insertions(+)
43
44diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
45index 423aa36f0150..f505d8dbdccf 100644
46--- a/arch/x86/kernel/vmlinux.lds.S
47+++ b/arch/x86/kernel/vmlinux.lds.S
48@@ -60,11 +60,17 @@ jiffies_64 = jiffies;
49 . = ALIGN(HPAGE_SIZE); \
50 __end_rodata_hpage_align = .;
51
52+#define ALIGN_ENTRY_TEXT_BEGIN . = ALIGN(PMD_SIZE);
53+#define ALIGN_ENTRY_TEXT_END . = ALIGN(PMD_SIZE);
54+
55 #else
56
57 #define X64_ALIGN_RODATA_BEGIN
58 #define X64_ALIGN_RODATA_END
59
60+#define ALIGN_ENTRY_TEXT_BEGIN
61+#define ALIGN_ENTRY_TEXT_END
62+
63 #endif
64
65 PHDRS {
66@@ -101,8 +107,10 @@ SECTIONS
67 CPUIDLE_TEXT
68 LOCK_TEXT
69 KPROBES_TEXT
70+ ALIGN_ENTRY_TEXT_BEGIN
71 ENTRY_TEXT
72 IRQENTRY_TEXT
73+ ALIGN_ENTRY_TEXT_END
74 SOFTIRQENTRY_TEXT
75 *(.fixup)
76 *(.gnu.warning)
77--
782.14.2
79