]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0219-x86-smpboot-Remove-stale-TLB-flush-invocations.patch
KPTI: add follow-up fixes
[pve-kernel.git] / patches / kernel / 0219-x86-smpboot-Remove-stale-TLB-flush-invocations.patch
CommitLineData
321d628a
FG
1From 079b59f4b5c810ea51534a8d7bcee4860589b5c1 Mon Sep 17 00:00:00 2001
2From: Thomas Gleixner <tglx@linutronix.de>
3Date: Sat, 30 Dec 2017 22:13:53 +0100
e4cdf2a5 4Subject: [PATCH 219/241] x86/smpboot: Remove stale TLB flush invocations
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11smpboot_setup_warm_reset_vector() and smpboot_restore_warm_reset_vector()
12invoke local_flush_tlb() for no obvious reason.
13
14Digging in history revealed that the original code in the 2.1 era added
15those because the code manipulated a swapper_pg_dir pagetable entry. The
16pagetable manipulation was removed long ago in the 2.3 timeframe, but the
17TLB flush invocations stayed around forever.
18
19Remove them along with the pointless pr_debug()s which come from the same 2.1
20change.
21
22Reported-by: Dominik Brodowski <linux@dominikbrodowski.net>
23Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
24Cc: <stable@vger.kernel.org>
25Cc: Andy Lutomirski <luto@kernel.org>
26Cc: Borislav Petkov <bp@alien8.de>
27Cc: Dave Hansen <dave.hansen@linux.intel.com>
28Cc: Linus Torvalds <torvalds@linux-foundation.org>
29Cc: Linus Torvalds <torvalds@linuxfoundation.org>
30Cc: Peter Zijlstra <peterz@infradead.org>
31Link: http://lkml.kernel.org/r/20171230211829.586548655@linutronix.de
32Signed-off-by: Ingo Molnar <mingo@kernel.org>
33(cherry picked from commit 322f8b8b340c824aef891342b0f5795d15e11562)
34Signed-off-by: Andy Whitcroft <apw@canonical.com>
35Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
36(cherry picked from commit fb08c4a80a22dc79c9775f493e291dfe2c642b86)
37Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
38---
39 arch/x86/kernel/smpboot.c | 9 ---------
40 1 file changed, 9 deletions(-)
41
42diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
43index 03d2ba2da3b0..6ad8391b9866 100644
44--- a/arch/x86/kernel/smpboot.c
45+++ b/arch/x86/kernel/smpboot.c
46@@ -128,25 +128,16 @@ static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
47 spin_lock_irqsave(&rtc_lock, flags);
48 CMOS_WRITE(0xa, 0xf);
49 spin_unlock_irqrestore(&rtc_lock, flags);
50- local_flush_tlb();
51- pr_debug("1.\n");
52 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) =
53 start_eip >> 4;
54- pr_debug("2.\n");
55 *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_LOW)) =
56 start_eip & 0xf;
57- pr_debug("3.\n");
58 }
59
60 static inline void smpboot_restore_warm_reset_vector(void)
61 {
62 unsigned long flags;
63
64- /*
65- * Install writable page 0 entry to set BIOS data area.
66- */
67- local_flush_tlb();
68-
69 /*
70 * Paranoid: Set warm reset code and vector here back
71 * to default values.
72--
732.14.2
74