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