| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Dave Hansen <[email protected]>
- Date: Sat, 6 Jan 2018 18:41:14 +0100
- Subject: [PATCH] x86/tboot: Unbreak tboot with PTI enabled
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- This is another case similar to what EFI does: create a new set of
- page tables, map some code at a low address, and jump to it. PTI
- mistakes this low address for userspace and mistakenly marks it
- non-executable in an effort to make it unusable for userspace.
- Undo the poison to allow execution.
- Fixes: 385ce0ea4c07 ("x86/mm/pti: Add Kconfig")
- Signed-off-by: Dave Hansen <[email protected]>
- Signed-off-by: Andrea Arcangeli <[email protected]>
- Signed-off-by: Thomas Gleixner <[email protected]>
- Cc: Alan Cox <[email protected]>
- Cc: Tim Chen <[email protected]>
- Cc: Jon Masters <[email protected]>
- Cc: Dave Hansen <[email protected]>
- Cc: Andi Kleen <[email protected]>
- Cc: Jeff Law <[email protected]>
- Cc: Paolo Bonzini <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Greg Kroah-Hartman <[email protected]>
- Cc: David" <[email protected]>
- Cc: Nick Clifton <[email protected]>
- Cc: [email protected]
- Link: https://lkml.kernel.org/r/[email protected]
- (cherry picked from commit 262b6b30087246abf09d6275eb0c0dc421bcbe38)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit f03e9108405491791f0b883a2d95e2620ddfce64)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- arch/x86/kernel/tboot.c | 1 +
- 1 file changed, 1 insertion(+)
- diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
- index a4eb27918ceb..75869a4b6c41 100644
- --- a/arch/x86/kernel/tboot.c
- +++ b/arch/x86/kernel/tboot.c
- @@ -127,6 +127,7 @@ static int map_tboot_page(unsigned long vaddr, unsigned long pfn,
- p4d = p4d_alloc(&tboot_mm, pgd, vaddr);
- if (!p4d)
- return -1;
- + pgd->pgd &= ~_PAGE_NX;
- pud = pud_alloc(&tboot_mm, p4d, vaddr);
- if (!pud)
- return -1;
- --
- 2.14.2
|