]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/spec_ctrl: Add missing 'lfence' when IBRS is not supported.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 9 Jan 2018 14:43:10 +0000 (09:43 -0500)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:25:30 +0000 (10:25 -0800)
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 <konrad.wilk@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/include/asm/spec_ctrl.h

index 26f1fac1fee9ff13e6715fb48e9f4d055603d423..6cce513f3fb27b651e5a4c0372da8c4c1e1d8134 100644 (file)
        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