Re: [patch 32/60] x86/mm/kpti: Allow NX poison to be set in p4d/pgd

From: Borislav Petkov
Date: Tue Dec 05 2017 - 12:09:58 EST


On Mon, Dec 04, 2017 at 03:07:38PM +0100, Thomas Gleixner wrote:
> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
> With KERNEL_PAGE_TABLE_ISOLATION the user portion of the kernel page
> tables is poisoned with the NX bit so if the entry code exits with the
> kernel page tables selected in CR3, userspace crashes.
>
> But doing so trips the p4d/pgd_bad() checks. Make sure it does not do
> that.
>
> Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>
> ---
> arch/x86/include/asm/pgtable.h | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)

Reviewed-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
--