From: Konrad Rzeszutek Wilk Date: Tue, 9 Jan 2018 17:11:51 +0000 (-0500) Subject: x86/ia32: Move STUFF_RSB And ENABLE_IBRS X-Git-Tag: v4.1.12-124.31.3~1284 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=eadbbc7a6770cd41ee761d2956205a2e30367753;p=users%2Fjedix%2Flinux-maple.git 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 --- 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