From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tim Chen Date: Fri, 20 Oct 2017 12:56:29 -0700 Subject: [PATCH] x86/mm: Set IBPB upon context switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CVE-2017-5753 CVE-2017-5715 Set IBPB on context switch with changing of page table. Signed-off-by: Tim Chen Signed-off-by: Andy Whitcroft Signed-off-by: Kleber Sacilotto de Souza (cherry picked from commit a3320203792b633fb96df5d0bbfb7036129b78e2) Signed-off-by: Fabian Grünbichler --- arch/x86/mm/tlb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 06f3854d0a4f..bb3ded3a4e5f 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -12,6 +12,7 @@ #include #include #include +#include #include /* @@ -218,6 +219,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next, u16 new_asid; bool need_flush; + if (boot_cpu_has(X86_FEATURE_SPEC_CTRL)) + native_wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB); + if (IS_ENABLED(CONFIG_VMAP_STACK)) { /* * If our current stack is in vmalloc space and isn't -- 2.14.2