]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0144-x86-entry-gdt-Put-per-CPU-GDT-remaps-in-ascending-or.patch
build: reformat existing patches
[pve-kernel.git] / patches / kernel / 0144-x86-entry-gdt-Put-per-CPU-GDT-remaps-in-ascending-or.patch
CommitLineData
59d5af67 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
321d628a
FG
2From: Andy Lutomirski <luto@kernel.org>
3Date: Mon, 4 Dec 2017 15:07:14 +0100
59d5af67 4Subject: [PATCH] x86/entry/gdt: Put per-CPU GDT remaps in ascending order
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11We currently have CPU 0's GDT at the top of the GDT range and
12higher-numbered CPUs at lower addresses. This happens because the
13fixmap is upside down (index 0 is the top of the fixmap).
14
15Flip it so that GDTs are in ascending order by virtual address.
16This will simplify a future patch that will generalize the GDT
17remap to contain multiple pages.
18
19Signed-off-by: Andy Lutomirski <luto@kernel.org>
20Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
21Reviewed-by: Borislav Petkov <bp@suse.de>
22Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
23Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
24Cc: Borislav Petkov <bp@alien8.de>
25Cc: Borislav Petkov <bpetkov@suse.de>
26Cc: Brian Gerst <brgerst@gmail.com>
27Cc: Dave Hansen <dave.hansen@intel.com>
28Cc: Dave Hansen <dave.hansen@linux.intel.com>
29Cc: David Laight <David.Laight@aculab.com>
30Cc: Denys Vlasenko <dvlasenk@redhat.com>
31Cc: Eduardo Valentin <eduval@amazon.com>
32Cc: Greg KH <gregkh@linuxfoundation.org>
33Cc: H. Peter Anvin <hpa@zytor.com>
34Cc: Josh Poimboeuf <jpoimboe@redhat.com>
35Cc: Juergen Gross <jgross@suse.com>
36Cc: Linus Torvalds <torvalds@linux-foundation.org>
37Cc: Peter Zijlstra <peterz@infradead.org>
38Cc: Rik van Riel <riel@redhat.com>
39Cc: Will Deacon <will.deacon@arm.com>
40Cc: aliguori@amazon.com
41Cc: daniel.gruss@iaik.tugraz.at
42Cc: hughd@google.com
43Cc: keescook@google.com
44Link: https://lkml.kernel.org/r/20171204150605.471561421@linutronix.de
45Signed-off-by: Ingo Molnar <mingo@kernel.org>
46(cherry picked from commit aaeed3aeb39c1ba69f0a49baec8cb728121d0a91)
47Signed-off-by: Andy Whitcroft <apw@canonical.com>
48Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
49(cherry picked from commit 9c37967fad2d6a525df53e0a40edcd652e5abaae)
50Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
51---
52 arch/x86/include/asm/desc.h | 2 +-
53 1 file changed, 1 insertion(+), 1 deletion(-)
54
55diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
56index f995e5a09136..22ee0a93b4f7 100644
57--- a/arch/x86/include/asm/desc.h
58+++ b/arch/x86/include/asm/desc.h
59@@ -61,7 +61,7 @@ static inline struct desc_struct *get_current_gdt_rw(void)
60 /* Get the fixmap index for a specific processor */
61 static inline unsigned int get_cpu_gdt_ro_index(int cpu)
62 {
63- return FIX_GDT_REMAP_BEGIN + cpu;
64+ return FIX_GDT_REMAP_END - cpu;
65 }
66
67 /* Provide the fixmap address of the remapped GDT */
68--
692.14.2
70