x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy
authorAndy Lutomirski <luto@kernel.org>
Mon, 11 Dec 2017 06:47:19 +0000 (22:47 -0800)
committerIngo Molnar <mingo@kernel.org>
Fri, 22 Dec 2017 19:13:01 +0000 (20:13 +0100)
commit49275fef986abfb8b476e4708aaecc07e7d3e087
tree9399ac6f7e74d1422e34de7164d62037fff80c25
parent146122e24bdf208015d629babba673e28d090709
x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy

The kernel is very erratic as to which pagetables have _PAGE_USER set.  The
vsyscall page gets lucky: it seems that all of the relevant pagetables are
among the apparently arbitrary ones that set _PAGE_USER.  Rather than
relying on chance, just explicitly set _PAGE_USER.

This will let us clean up pagetable setup to stop setting _PAGE_USER.  The
added code can also be reused by pagetable isolation to manage the
_PAGE_USER bit in the usermode tables.

[ tglx: Folded paravirt fix from Juergen Gross ]

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>
arch/x86/entry/vsyscall/vsyscall_64.c