| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Andy Lutomirski <[email protected]>
- Date: Mon, 4 Dec 2017 15:07:14 +0100
- Subject: [PATCH] x86/entry/gdt: Put per-CPU GDT remaps in ascending order
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- We currently have CPU 0's GDT at the top of the GDT range and
- higher-numbered CPUs at lower addresses. This happens because the
- fixmap is upside down (index 0 is the top of the fixmap).
- Flip it so that GDTs are in ascending order by virtual address.
- This will simplify a future patch that will generalize the GDT
- remap to contain multiple pages.
- Signed-off-by: Andy Lutomirski <[email protected]>
- Signed-off-by: Thomas Gleixner <[email protected]>
- Reviewed-by: Borislav Petkov <[email protected]>
- Reviewed-by: Thomas Gleixner <[email protected]>
- Cc: Boris Ostrovsky <[email protected]>
- Cc: Borislav Petkov <[email protected]>
- Cc: Borislav Petkov <[email protected]>
- Cc: Brian Gerst <[email protected]>
- Cc: Dave Hansen <[email protected]>
- Cc: Dave Hansen <[email protected]>
- Cc: David Laight <[email protected]>
- Cc: Denys Vlasenko <[email protected]>
- Cc: Eduardo Valentin <[email protected]>
- Cc: Greg KH <[email protected]>
- Cc: H. Peter Anvin <[email protected]>
- Cc: Josh Poimboeuf <[email protected]>
- Cc: Juergen Gross <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Peter Zijlstra <[email protected]>
- Cc: Rik van Riel <[email protected]>
- Cc: Will Deacon <[email protected]>
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Link: https://lkml.kernel.org/r/[email protected]
- Signed-off-by: Ingo Molnar <[email protected]>
- (cherry picked from commit aaeed3aeb39c1ba69f0a49baec8cb728121d0a91)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit 9c37967fad2d6a525df53e0a40edcd652e5abaae)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- arch/x86/include/asm/desc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
- index f995e5a09136..22ee0a93b4f7 100644
- --- a/arch/x86/include/asm/desc.h
- +++ b/arch/x86/include/asm/desc.h
- @@ -61,7 +61,7 @@ static inline struct desc_struct *get_current_gdt_rw(void)
- /* Get the fixmap index for a specific processor */
- static inline unsigned int get_cpu_gdt_ro_index(int cpu)
- {
- - return FIX_GDT_REMAP_BEGIN + cpu;
- + return FIX_GDT_REMAP_END - cpu;
- }
-
- /* Provide the fixmap address of the remapped GDT */
- --
- 2.14.2
|