It won't end well - especially as we need to be careful about
touching kernel variables and can only do that in the kernel cr3.
The code:
movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
may lead one to believe you can access kernel variables, but in fact
we haven't yet switched over the kernel cr3.
Orabug:
27344012
CVE: CVE-2017-5715
Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
cld
movq %rsp, %rdx
movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
- ENABLE_IBRS
pushq 5*8(%rdx) /* pt_regs->ss */
pushq 4*8(%rdx) /* pt_regs->rsp */
pushq 3*8(%rdx) /* pt_regs->flags */
movq %rax, %cr3
2:
#endif
+ ENABLE_IBRS
call do_nmi
DISABLE_IBRS
#ifdef CONFIG_PAGE_TABLE_ISOLATION