From b66aff637834a1bb791d42ec97c7cb027570eb5c Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Sun, 7 Jan 2018 11:30:51 -0500 Subject: [PATCH] x86/spec: Actually do the check for in_use on ENABLE_IBRS Orabug: 27344012 CVE: CVE-2017-5715 Reported-by: Boris Ostrovsky Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Kirtikar Kashyap --- arch/x86/include/asm/spec_ctrl.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/spec_ctrl.h b/arch/x86/include/asm/spec_ctrl.h index 5f7e27644a81..26f1fac1fee9 100644 --- a/arch/x86/include/asm/spec_ctrl.h +++ b/arch/x86/include/asm/spec_ctrl.h @@ -128,7 +128,10 @@ add $(32*8), %rsp; .macro ENABLE_IBRS -ALTERNATIVE "", __stringify(__ASM_ENABLE_IBRS), X86_FEATURE_SPEC_CTRL + testl $SPEC_CTRL_IBRS_INUSE, use_ibrs + jz 7f + __ASM_ENABLE_IBRS +7: .endm .macro ENABLE_IBRS_CLOBBER -- 2.50.1