Re: [patch V163 02/51] x86/vsyscall/64: Explicitly set _PAGE_USER in the pagetable hierarchy

From: Borislav Petkov
Date: Mon Dec 18 2017 - 09:21:26 EST

On Mon, Dec 18, 2017 at 12:42:17PM +0100, Thomas Gleixner wrote:
> From: Andy Lutomirski <luto@xxxxxxxxxx>
> 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.
> Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxx>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Brian Gerst <brgerst@xxxxxxxxx>
> Cc: David Laight <David.Laight@xxxxxxxxxx>
> Cc: Kees Cook <keescook@xxxxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> ---
> arch/x86/entry/vsyscall/vsyscall_64.c | 33 ++++++++++++++++++++++++++++++++-
> 1 file changed, 32 insertions(+), 1 deletion(-)


Reviewed-by: Borislav Petkov <bp@xxxxxxx>


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