Skip to content

Commit

Permalink
x86/mm/pti: Map ESPFIX into user space
Browse files Browse the repository at this point in the history
Map the ESPFIX pages into user space when PTI is enabled.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Laight <David.Laight@aculab.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Andy Lutomirski authored and Ingo Molnar committed Dec 23, 2017
1 parent 6dc72c3 commit 4b6bbe9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/x86/mm/pti.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,16 @@ static void __init pti_clone_user_shared(void)
pti_clone_p4d(CPU_ENTRY_AREA_BASE);
}

/*
* Clone the ESPFIX P4D into the user space visinble page table
*/
static void __init pti_setup_espfix64(void)
{
#ifdef CONFIG_X86_ESPFIX64
pti_clone_p4d(ESPFIX_BASE_ADDR);
#endif
}

/*
* Clone the populated PMDs of the entry and irqentry text and force it RO.
*/
Expand All @@ -308,4 +318,5 @@ void __init pti_init(void)

pti_clone_user_shared();
pti_clone_entry_text();
pti_setup_espfix64();
}

0 comments on commit 4b6bbe9

Please sign in to comment.