Borislav Petkov f78998
From: Andy Lutomirski <luto@kernel.org>
Borislav Petkov f78998
Date: Sat, 14 Oct 2017 09:59:49 -0700
Borislav Petkov f78998
Subject: x86/mm/64: Remove the last VM_BUG_ON() from the TLB code
Borislav Petkov f78998
Git-commit: e8b9b0cc8269c85d8167aaee024bfcbb4976c031
Borislav Petkov f78998
Patch-mainline: v4.14-rc6
Borislav Petkov f78998
References: bsc#1068032 CVE-2017-5754
Borislav Petkov f78998
Borislav Petkov f78998
Let's avoid hard-to-diagnose crashes in the future.
Borislav Petkov f78998
Borislav Petkov f78998
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Borislav Petkov f78998
Cc: Borislav Petkov <bp@alien8.de>
Borislav Petkov f78998
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Borislav Petkov f78998
Cc: Peter Zijlstra <peterz@infradead.org>
Borislav Petkov f78998
Cc: Thomas Gleixner <tglx@linutronix.de>
Borislav Petkov f78998
Link: http://lkml.kernel.org/r/f423bbc97864089fbdeb813f1ea126c6eaed844a.1508000261.git.luto@kernel.org
Borislav Petkov f78998
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Borislav Petkov f78998
Acked-by: Borislav Petkov <bp@suse.de>
Borislav Petkov f78998
---
Borislav Petkov f78998
 arch/x86/mm/tlb.c | 4 ++--
Borislav Petkov f78998
 1 file changed, 2 insertions(+), 2 deletions(-)
Borislav Petkov f78998
Borislav Petkov f78998
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
Borislav Petkov f78998
index 658bf0090565..7db23f9f804e 100644
Borislav Petkov f78998
--- a/arch/x86/mm/tlb.c
Borislav Petkov f78998
+++ b/arch/x86/mm/tlb.c
Borislav Petkov f78998
@@ -147,8 +147,8 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
Borislav Petkov f78998
 	this_cpu_write(cpu_tlbstate.is_lazy, false);
Borislav Petkov f78998
 
Borislav Petkov f78998
 	if (real_prev == next) {
Borislav Petkov f78998
-		VM_BUG_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) !=
Borislav Petkov f78998
-			  next->context.ctx_id);
Borislav Petkov f78998
+		VM_WARN_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) !=
Borislav Petkov f78998
+			   next->context.ctx_id);
Borislav Petkov f78998
 
Borislav Petkov f78998
 		/*
Borislav Petkov f78998
 		 * We don't currently support having a real mm loaded without
Borislav Petkov f78998