]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86: Fix spectre/kpti integration
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Sun, 7 Jan 2018 04:25:30 +0000 (23:25 -0500)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:20:12 +0000 (10:20 -0800)
commite60d4c586a6214f7b336dfd31a58a689e0b7b26f
tree500d3eecc1424b6a8384629c7188f2335cf2fb7b
parent693b3d6fd677a0ff7206f9f4edb2e5eef1a89fdf
x86: Fix spectre/kpti integration

The issue is that DISABLE_IBRS (and pretty much all of the _IBRS) first
operation is touching an kernel variable. The restore_c_regs_and_iret is
already in user-space cr3 so we page fault.

The fix is simple - do not run any of the IBRS macros from within
restore_c_regs_and_iret. Which means that the three functions that
used to call it now have to call IBRS_DISABLE by themselves:
retint_swapgs, opportunistic_sysret_failed, and nmi.

Adding in the IBRS_DISABLE in opportunistic_sysret_failed also
fixes another bug - which is more clearly explained in
"x86/enter: Use IBRS on syscall and interrupts  - fix ia32 path"

Orabug: 27333760
CVE: CVE-2017-5754
Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/kernel/entry_64.S