| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Tim Chen <[email protected]>
- 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 <[email protected]>
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit a3320203792b633fb96df5d0bbfb7036129b78e2)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- 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 <asm/cache.h>
- #include <asm/apic.h>
- #include <asm/uv/uv.h>
- +#include <asm/microcode.h>
- #include <linux/debugfs.h>
-
- /*
- @@ -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
|