summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/vsyscall.h
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2019-06-27 07:45:04 +0300
committerThomas Gleixner <tglx@linutronix.de>2019-06-28 01:04:39 +0300
commit918ce325098a4eef99daad7b6796da33cebaf03a (patch)
tree350e3c5a1bae0686cb0050a466b85917792e4b7f /arch/x86/include/asm/vsyscall.h
parentbd49e16e3339f052fae05fb3e955c5db0c9c6445 (diff)
downloadlinux-918ce325098a4eef99daad7b6796da33cebaf03a.tar.xz
x86/vsyscall: Show something useful on a read fault
Just segfaulting the application when it tries to read the vsyscall page in xonly mode is not helpful for those who need to debug it. Emit a hint. Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kees Cook <keescook@chromium.org> Cc: Florian Weimer <fweimer@redhat.com> Cc: Jann Horn <jannh@google.com> Link: https://lkml.kernel.org/r/8016afffe0eab497be32017ad7f6f7030dc3ba66.1561610354.git.luto@kernel.org
Diffstat (limited to 'arch/x86/include/asm/vsyscall.h')
-rw-r--r--arch/x86/include/asm/vsyscall.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/include/asm/vsyscall.h b/arch/x86/include/asm/vsyscall.h
index b986b2ca688a..ab60a71a8dcb 100644
--- a/arch/x86/include/asm/vsyscall.h
+++ b/arch/x86/include/asm/vsyscall.h
@@ -13,10 +13,12 @@ extern void set_vsyscall_pgtable_user_bits(pgd_t *root);
* Called on instruction fetch fault in vsyscall page.
* Returns true if handled.
*/
-extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
+extern bool emulate_vsyscall(unsigned long error_code,
+ struct pt_regs *regs, unsigned long address);
#else
static inline void map_vsyscall(void) {}
-static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
+static inline bool emulate_vsyscall(unsigned long error_code,
+ struct pt_regs *regs, unsigned long address)
{
return false;
}