From feadf496426566a1a0850d0ad3de06112fbf6b73 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Tue, 9 Jan 2018 09:43:10 -0500 Subject: [PATCH] x86/spec_ctrl: Add missing 'lfence' when IBRS is not supported. As a way for machines without the speculation MSR to thwart the speculation engine (along with the stuffing of RSBs). Orabug: 27344012 CVE:CVE-2017-5715 Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Brian Maly Signed-off-by: Kirtikar Kashyap --- arch/x86/include/asm/spec_ctrl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/spec_ctrl.h b/arch/x86/include/asm/spec_ctrl.h index 26f1fac1fee9..6cce513f3fb2 100644 --- a/arch/x86/include/asm/spec_ctrl.h +++ b/arch/x86/include/asm/spec_ctrl.h @@ -131,14 +131,20 @@ testl $SPEC_CTRL_IBRS_INUSE, use_ibrs jz 7f __ASM_ENABLE_IBRS + jmp 20f 7: + lfence +20: .endm .macro ENABLE_IBRS_CLOBBER testl $SPEC_CTRL_IBRS_INUSE, use_ibrs jz 11f __ASM_ENABLE_IBRS_CLOBBER + jmp 21f 11: + lfence +21: .endm .macro ENABLE_IBRS_SAVE_AND_CLOBBER save_reg:req -- 2.50.1