From d70e64daf839dbbcd534c982f2df2035f5a3f518 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 8 Jan 2018 22:58:20 -0500 Subject: [PATCH] x86/spec/ia32: Sprinkle IBRS and RSB at the 32-bit SYSCALL We missed them in the first round of backporting. Also move the DISABLE_IBRS _after_ the trace_hardirqs_on_caller call. Orabug: 27344012 CVE:CVE-2017-5715 Signed-off-by: Konrad Rzeszutek Wilk --- v2: Move the DISABLE_IBRS after the TRACE_HARDIRQ macro Move the ENABLE_IBRS up Signed-off-by: Brian Maly Signed-off-by: Kirtikar Kashyap --- arch/x86/ia32/ia32entry.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 9d7a93bd8bb1..36d3ec7e4cdc 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S @@ -373,6 +373,10 @@ ENTRY(ia32_cstar_target) movl %esp,%r8d CFI_REGISTER rsp,r8 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 */ @@ -435,6 +439,7 @@ sysretl_from_sys_call: xorq %r9,%r9 xorq %r8,%r8 TRACE_IRQS_ON + DISABLE_IBRS SWITCH_USER_CR3 movl RSP(%rsp),%esp CFI_RESTORE rsp -- 2.50.1