diff options
author | Andy Lutomirski <luto@kernel.org> | 2017-12-11 01:47:20 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-12-22 14:13:01 -0500 |
commit | 4831b779403a836158917d59a7ca880483c67378 (patch) | |
tree | 8c074202b490f0b7f5f069af2da96ec95d6fe288 | |
parent | 49275fef986abfb8b476e4708aaecc07e7d3e087 (diff) |
x86/vsyscall/64: Warn and fail vsyscall emulation in NATIVE mode
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: 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>
-rw-r--r-- | arch/x86/entry/vsyscall/vsyscall_64.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry/vsyscall/vsyscall_64.c index daad57c76e42..1faf40f2dda9 100644 --- a/arch/x86/entry/vsyscall/vsyscall_64.c +++ b/arch/x86/entry/vsyscall/vsyscall_64.c | |||
@@ -139,6 +139,10 @@ bool emulate_vsyscall(struct pt_regs *regs, unsigned long address) | |||
139 | 139 | ||
140 | WARN_ON_ONCE(address != regs->ip); | 140 | WARN_ON_ONCE(address != regs->ip); |
141 | 141 | ||
142 | /* This should be unreachable in NATIVE mode. */ | ||
143 | if (WARN_ON(vsyscall_mode == NATIVE)) | ||
144 | return false; | ||
145 | |||
142 | if (vsyscall_mode == NONE) { | 146 | if (vsyscall_mode == NONE) { |
143 | warn_bad_vsyscall(KERN_INFO, regs, | 147 | warn_bad_vsyscall(KERN_INFO, regs, |
144 | "vsyscall attempted with vsyscall=none"); | 148 | "vsyscall attempted with vsyscall=none"); |