]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0245-x86-pti-Make-sure-the-user-kernel-PTEs-match.patch
update ZFS to 0.7.4 + ARC hit rate cherry-pick
[pve-kernel.git] / patches / kernel / 0245-x86-pti-Make-sure-the-user-kernel-PTEs-match.patch
CommitLineData
035dbe67
FG
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Thomas Gleixner <tglx@linutronix.de>
3Date: Wed, 3 Jan 2018 15:57:59 +0100
4Subject: [PATCH] x86/pti: Make sure the user/kernel PTEs match
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11Meelis reported that his K8 Athlon64 emits MCE warnings when PTI is
12enabled:
13
14[Hardware Error]: Error Addr: 0x0000ffff81e000e0
15[Hardware Error]: MC1 Error: L1 TLB multimatch.
16[Hardware Error]: cache level: L1, tx: INSN
17
18The address is in the entry area, which is mapped into kernel _AND_ user
19space. That's special because we switch CR3 while we are executing
20there.
21
22User mapping:
230xffffffff81e00000-0xffffffff82000000 2M ro PSE GLB x pmd
24
25Kernel mapping:
260xffffffff81000000-0xffffffff82000000 16M ro PSE x pmd
27
28So the K8 is complaining that the TLB entries differ. They differ in the
29GLB bit.
30
31Drop the GLB bit when installing the user shared mapping.
32
33Fixes: 6dc72c3cbca0 ("x86/mm/pti: Share entry text PMD")
34Reported-by: Meelis Roos <mroos@linux.ee>
35Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
36Tested-by: Meelis Roos <mroos@linux.ee>
37Cc: Borislav Petkov <bp@alien8.de>
38Cc: Tom Lendacky <thomas.lendacky@amd.com>
39Cc: stable@vger.kernel.org
40Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801031407180.1957@nanos
41(cherry picked from commit 52994c256df36fda9a715697431cba9daecb6b11)
42Signed-off-by: Andy Whitcroft <apw@canonical.com>
43Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
44(cherry picked from commit 8a95d206afc447d8461815c67e618bd8b2c6457f)
45Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
46---
47 arch/x86/mm/pti.c | 3 ++-
48 1 file changed, 2 insertions(+), 1 deletion(-)
49
50diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
51index bce8aea65606..2da28ba97508 100644
52--- a/arch/x86/mm/pti.c
53+++ b/arch/x86/mm/pti.c
54@@ -367,7 +367,8 @@ static void __init pti_setup_espfix64(void)
55 static void __init pti_clone_entry_text(void)
56 {
57 pti_clone_pmds((unsigned long) __entry_text_start,
58- (unsigned long) __irqentry_text_end, _PAGE_RW);
59+ (unsigned long) __irqentry_text_end,
60+ _PAGE_RW | _PAGE_GLOBAL);
61 }
62
63 /*
64--
652.14.2
66