Re: [PATCH PTI v3 01/10] x86/espfix/64: Fix espfix double-fault handling on 5-level systems

From: Kirill A. Shutemov
Date: Tue Dec 12 2017 - 12:19:00 EST


On Tue, Dec 12, 2017 at 07:56:36AM -0800, Andy Lutomirski wrote:
> Using PGDIR_SHIFT to identify espfix64 addresses on 5-level systems
> was wrong, and it resulted in panics due to unhandled double faults.
> Use P4D_SHIFT instead, which is correct on 4-level and 5-level
> machines.
>
> This fixes a panic when running x86 selftests on 5-level machines.
>
> Fixes: 1d33b219563f ("x86/espfix: Add support for 5-level paging")
> Cc: stable@xxxxxxxxxxxxxxx
> Cc: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxx>
> Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxx>

Thanks for catching this.

Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

I remember that I tested espfix before and it was fine. That's strange.

With this patch on top of tip/WIP.x86/pti plus the change I've mentioned
before, sigreturn_64 doesn't crash qemu for me anymore.

--
Kirill A. Shutemov