lkml.org 
[lkml]   [2017]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch V163 03/51] x86/vsyscall/64: Warn and fail vsyscall emulation in NATIVE mode
On Mon, Dec 18, 2017 at 12:42:18PM +0100, Thomas Gleixner wrote:
> From: Andy Lutomirski <luto@kernel.org>
>
> If something goes wrong with pagetable setup, vsyscall=native will
> accidentally fall back to emulation. Make it warn and fail so that we
> notice.
>
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: David Laight <David.Laight@aculab.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> ---
> arch/x86/entry/vsyscall/vsyscall_64.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> --- a/arch/x86/entry/vsyscall/vsyscall_64.c
> +++ b/arch/x86/entry/vsyscall/vsyscall_64.c
> @@ -138,6 +138,10 @@ bool emulate_vsyscall(struct pt_regs *re
>
> WARN_ON_ONCE(address != regs->ip);
>
> + /* This should be unreachable in NATIVE mode. */
> + if (WARN_ON(vsyscall_mode == NATIVE))
> + return false;

There's this nice warn_bad_vsyscall() thing. Why not use that?

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2017-12-18 15:46    [W:0.319 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site