summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/kdebug.h
diff options
context:
space:
mode:
authorJann Horn <jannh@google.com>2018-08-31 21:41:51 +0200
committerThomas Gleixner <tglx@linutronix.de>2018-09-06 14:33:12 +0200
commit9fe6299dde587788f245e9f7a5a1b296fad4e8c7 (patch)
tree45fd4582b522ebfe51c990470f409ba66ba22f17 /arch/x86/include/asm/kdebug.h
parentx86/tsc: Prevent result truncation on 32bit (diff)
downloadlinux-9fe6299dde587788f245e9f7a5a1b296fad4e8c7.tar.xz
linux-9fe6299dde587788f245e9f7a5a1b296fad4e8c7.zip
x86/process: Don't mix user/kernel regs in 64bit __show_regs()
When the kernel.print-fatal-signals sysctl has been enabled, a simple userspace crash will cause the kernel to write a crash dump that contains, among other things, the kernel gsbase into dmesg. As suggested by Andy, limit output to pt_regs, FS_BASE and KERNEL_GS_BASE in this case. This also moves the bitness-specific logic from show_regs() into process_{32,64}.c. Fixes: 45807a1df9f5 ("vdso: print fatal signals") Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bpetkov@suse.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180831194151.123586-1-jannh@google.com
Diffstat (limited to 'arch/x86/include/asm/kdebug.h')
-rw-r--r--arch/x86/include/asm/kdebug.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kdebug.h b/arch/x86/include/asm/kdebug.h
index 395c9631e000..75f1e35e7c15 100644
--- a/arch/x86/include/asm/kdebug.h
+++ b/arch/x86/include/asm/kdebug.h
@@ -22,10 +22,20 @@ enum die_val {
DIE_NMIUNKNOWN,
};
+enum show_regs_mode {
+ SHOW_REGS_SHORT,
+ /*
+ * For when userspace crashed, but we don't think it's our fault, and
+ * therefore don't print kernel registers.
+ */
+ SHOW_REGS_USER,
+ SHOW_REGS_ALL
+};
+
extern void die(const char *, struct pt_regs *,long);
extern int __must_check __die(const char *, struct pt_regs *, long);
extern void show_stack_regs(struct pt_regs *regs);
-extern void __show_regs(struct pt_regs *regs, int all);
+extern void __show_regs(struct pt_regs *regs, enum show_regs_mode);
extern void show_iret_regs(struct pt_regs *regs);
extern unsigned long oops_begin(void);
extern void oops_end(unsigned long, struct pt_regs *, int signr);