]>
Commit | Line | Data |
---|---|---|
59d5af67 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
321d628a FG |
2 | From: Andy Lutomirski <luto@kernel.org> |
3 | Date: Mon, 4 Dec 2017 15:07:14 +0100 | |
59d5af67 | 4 | Subject: [PATCH] x86/entry/gdt: Put per-CPU GDT remaps in ascending order |
321d628a FG |
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 | We currently have CPU 0's GDT at the top of the GDT range and | |
12 | higher-numbered CPUs at lower addresses. This happens because the | |
13 | fixmap is upside down (index 0 is the top of the fixmap). | |
14 | ||
15 | Flip it so that GDTs are in ascending order by virtual address. | |
16 | This will simplify a future patch that will generalize the GDT | |
17 | remap to contain multiple pages. | |
18 | ||
19 | Signed-off-by: Andy Lutomirski <luto@kernel.org> | |
20 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
21 | Reviewed-by: Borislav Petkov <bp@suse.de> | |
22 | Reviewed-by: Thomas Gleixner <tglx@linutronix.de> | |
23 | Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> | |
24 | Cc: Borislav Petkov <bp@alien8.de> | |
25 | Cc: Borislav Petkov <bpetkov@suse.de> | |
26 | Cc: Brian Gerst <brgerst@gmail.com> | |
27 | Cc: Dave Hansen <dave.hansen@intel.com> | |
28 | Cc: Dave Hansen <dave.hansen@linux.intel.com> | |
29 | Cc: David Laight <David.Laight@aculab.com> | |
30 | Cc: Denys Vlasenko <dvlasenk@redhat.com> | |
31 | Cc: Eduardo Valentin <eduval@amazon.com> | |
32 | Cc: Greg KH <gregkh@linuxfoundation.org> | |
33 | Cc: H. Peter Anvin <hpa@zytor.com> | |
34 | Cc: Josh Poimboeuf <jpoimboe@redhat.com> | |
35 | Cc: Juergen Gross <jgross@suse.com> | |
36 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
37 | Cc: Peter Zijlstra <peterz@infradead.org> | |
38 | Cc: Rik van Riel <riel@redhat.com> | |
39 | Cc: Will Deacon <will.deacon@arm.com> | |
40 | Cc: aliguori@amazon.com | |
41 | Cc: daniel.gruss@iaik.tugraz.at | |
42 | Cc: hughd@google.com | |
43 | Cc: keescook@google.com | |
44 | Link: https://lkml.kernel.org/r/20171204150605.471561421@linutronix.de | |
45 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
46 | (cherry picked from commit aaeed3aeb39c1ba69f0a49baec8cb728121d0a91) | |
47 | Signed-off-by: Andy Whitcroft <apw@canonical.com> | |
48 | Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> | |
49 | (cherry picked from commit 9c37967fad2d6a525df53e0a40edcd652e5abaae) | |
50 | Signed-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 | ||
55 | diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h | |
56 | index 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 | -- | |
69 | 2.14.2 | |
70 |