]> git.proxmox.com Git - pve-kernel.git/blob - patches/kernel/0253-x86-tboot-Unbreak-tboot-with-PTI-enabled.patch
aa0048e2785ff880f9ddde24b2a279f45981ba75
[pve-kernel.git] / patches / kernel / 0253-x86-tboot-Unbreak-tboot-with-PTI-enabled.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Dave Hansen <dave.hansen@linux.intel.com>
3 Date: Sat, 6 Jan 2018 18:41:14 +0100
4 Subject: [PATCH] x86/tboot: Unbreak tboot with PTI enabled
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 This is another case similar to what EFI does: create a new set of
12 page tables, map some code at a low address, and jump to it. PTI
13 mistakes this low address for userspace and mistakenly marks it
14 non-executable in an effort to make it unusable for userspace.
15
16 Undo the poison to allow execution.
17
18 Fixes: 385ce0ea4c07 ("x86/mm/pti: Add Kconfig")
19 Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
20 Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
21 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
22 Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
23 Cc: Tim Chen <tim.c.chen@linux.intel.com>
24 Cc: Jon Masters <jcm@redhat.com>
25 Cc: Dave Hansen <dave.hansen@intel.com>
26 Cc: Andi Kleen <andi@firstfloor.org>
27 Cc: Jeff Law <law@redhat.com>
28 Cc: Paolo Bonzini <pbonzini@redhat.com>
29 Cc: Linus Torvalds <torvalds@linux-foundation.org>
30 Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
31 Cc: David" <dwmw@amazon.co.uk>
32 Cc: Nick Clifton <nickc@redhat.com>
33 Cc: stable@vger.kernel.org
34 Link: https://lkml.kernel.org/r/20180108102805.GK25546@redhat.com
35 (cherry picked from commit 262b6b30087246abf09d6275eb0c0dc421bcbe38)
36 Signed-off-by: Andy Whitcroft <apw@canonical.com>
37 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
38 (cherry picked from commit f03e9108405491791f0b883a2d95e2620ddfce64)
39 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
40 ---
41 arch/x86/kernel/tboot.c | 1 +
42 1 file changed, 1 insertion(+)
43
44 diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
45 index a4eb27918ceb..75869a4b6c41 100644
46 --- a/arch/x86/kernel/tboot.c
47 +++ b/arch/x86/kernel/tboot.c
48 @@ -127,6 +127,7 @@ static int map_tboot_page(unsigned long vaddr, unsigned long pfn,
49 p4d = p4d_alloc(&tboot_mm, pgd, vaddr);
50 if (!p4d)
51 return -1;
52 + pgd->pgd &= ~_PAGE_NX;
53 pud = pud_alloc(&tboot_mm, p4d, vaddr);
54 if (!pud)
55 return -1;
56 --
57 2.14.2
58