]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0199-x86-entry-Align-entry-text-section-to-PMD-boundary.patch
build: reformat existing patches
[pve-kernel.git] / patches / kernel / 0199-x86-entry-Align-entry-text-section-to-PMD-boundary.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Mon, 4 Dec 2017 15:07:46 +0100
4 Subject: [PATCH] x86/entry: Align entry text section to PMD boundary
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 CVE-2017-5754
10
11 The (irq)entry text must be visible in the user space page tables. To allow
12 simple PMD based sharing, make the entry text PMD aligned.
13
14 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15 Cc: Andy Lutomirski <luto@kernel.org>
16 Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
17 Cc: Borislav Petkov <bp@alien8.de>
18 Cc: Brian Gerst <brgerst@gmail.com>
19 Cc: Dave Hansen <dave.hansen@linux.intel.com>
20 Cc: David Laight <David.Laight@aculab.com>
21 Cc: Denys Vlasenko <dvlasenk@redhat.com>
22 Cc: Eduardo Valentin <eduval@amazon.com>
23 Cc: Greg KH <gregkh@linuxfoundation.org>
24 Cc: H. Peter Anvin <hpa@zytor.com>
25 Cc: Josh Poimboeuf <jpoimboe@redhat.com>
26 Cc: Juergen Gross <jgross@suse.com>
27 Cc: Linus Torvalds <torvalds@linux-foundation.org>
28 Cc: Peter Zijlstra <peterz@infradead.org>
29 Cc: Will Deacon <will.deacon@arm.com>
30 Cc: aliguori@amazon.com
31 Cc: daniel.gruss@iaik.tugraz.at
32 Cc: hughd@google.com
33 Cc: keescook@google.com
34 Signed-off-by: Ingo Molnar <mingo@kernel.org>
35 (cherry picked from commit 2f7412ba9c6af5ab16bdbb4a3fdb1dcd2b4fd3c2)
36 Signed-off-by: Andy Whitcroft <apw@canonical.com>
37 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
38 (cherry picked from commit 3cf72b14b56834882ebe731d5fa84d249c56a188)
39 Signed-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
44 diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
45 index 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 --
78 2.14.2
79