From eadbbc7a6770cd41ee761d2956205a2e30367753 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Tue, 9 Jan 2018 12:11:51 -0500 Subject: [PATCH] x86/ia32: Move STUFF_RSB And ENABLE_IBRS The: x86/entry: Stuff RSB for entry to kernel for non-SMEP platform x86/enter: Use IBRS on syscall and interrupts backports put the macros after the ENABLE_INTERRUPTS, but in case the ENABLE_INTERRUPTS macro unrolls, let put it above it. Orabug: 27344012 CVE:CVE-2017-5715 Reported-by: Boris Ostrovsky Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Brian Maly Signed-off-by: Kirtikar Kashyap --- arch/x86/ia32/ia32entry.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index eebb13d11c09..9d7a93bd8bb1 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S @@ -124,6 +124,10 @@ ENTRY(ia32_sysenter_target) SWAPGS_UNSAFE_STACK SWITCH_KERNEL_CR3_NO_STACK movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp + + ENABLE_IBRS + STUFF_RSB + ENABLE_INTERRUPTS(CLBR_NONE) /* Zero-extending 32-bit regs, do not remove */ @@ -153,8 +157,6 @@ ENTRY(ia32_sysenter_target) SAVE_EXTRA_REGS CLEAR_R8_TO_R15 - ENABLE_IBRS - STUFF_RSB /* * no need to do an access_ok check here because rbp has been -- 2.50.1