]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0253-x86-tboot-Unbreak-tboot-with-PTI-enabled.patch
update ZFS to 0.7.4 + ARC hit rate cherry-pick
[pve-kernel.git] / patches / kernel / 0253-x86-tboot-Unbreak-tboot-with-PTI-enabled.patch
CommitLineData
035dbe67
FG
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Dave Hansen <dave.hansen@linux.intel.com>
3Date: Sat, 6 Jan 2018 18:41:14 +0100
4Subject: [PATCH] x86/tboot: Unbreak tboot with PTI enabled
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11This is another case similar to what EFI does: create a new set of
12page tables, map some code at a low address, and jump to it. PTI
13mistakes this low address for userspace and mistakenly marks it
14non-executable in an effort to make it unusable for userspace.
15
16Undo the poison to allow execution.
17
18Fixes: 385ce0ea4c07 ("x86/mm/pti: Add Kconfig")
19Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
20Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
21Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
22Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
23Cc: Tim Chen <tim.c.chen@linux.intel.com>
24Cc: Jon Masters <jcm@redhat.com>
25Cc: Dave Hansen <dave.hansen@intel.com>
26Cc: Andi Kleen <andi@firstfloor.org>
27Cc: Jeff Law <law@redhat.com>
28Cc: Paolo Bonzini <pbonzini@redhat.com>
29Cc: Linus Torvalds <torvalds@linux-foundation.org>
30Cc: Greg Kroah-Hartman <gregkh@linux-foundation.org>
31Cc: David" <dwmw@amazon.co.uk>
32Cc: Nick Clifton <nickc@redhat.com>
33Cc: stable@vger.kernel.org
34Link: https://lkml.kernel.org/r/20180108102805.GK25546@redhat.com
35(cherry picked from commit 262b6b30087246abf09d6275eb0c0dc421bcbe38)
36Signed-off-by: Andy Whitcroft <apw@canonical.com>
37Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
38(cherry picked from commit f03e9108405491791f0b883a2d95e2620ddfce64)
39Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
40---
41 arch/x86/kernel/tboot.c | 1 +
42 1 file changed, 1 insertion(+)
43
44diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
45index 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--
572.14.2
58