On 01/03/2018 02:14 PM, Andy Lutomirski wrote:
> +       /* Use %rsp as scratch reg. User ESP is stashed in r8 */
> +       SWITCH_TO_KERNEL_CR3 scratch_reg=%rsp
> +
> +       /* Switch to the kernel stack */
>         movq    PER_CPU_VAR(cpu_current_top_of_stack), %rsp

The stack is unreadable at this point without the CR3 switch.

> What's the issue that this is fixing?

Users doing 32-bit SYSCALLs on the CPUs that support them double fault
since they end up with an %rsp that they can't access.

Reply via email to