lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <4ED49D610200007800063F68@nat28.tlf.novell.com>
Date:	Tue, 29 Nov 2011 07:52:49 +0000
From:	"Jan Beulich" <JBeulich@...e.com>
To:	<mingo@...e.hu>, <tglx@...utronix.de>, <hpa@...or.com>
Cc:	<linux-kernel@...r.kernel.org>
Subject: [PATCH] x86: avoid double stack traces (from show_registers())

What was called show_registers() so far already showed a stack trace
for kernel faults, and kernel_stack_pointer() isn't even valid (ix86)
or meaningful (x86-64) to be used here for faults from user mode,
hence it was pointless for show_regs() to call show_trace() after
show_registers(). Simply rename show_registers() to show_regs() and
eliminate the old definition.

Signed-off-by: Jan Beulich <jbeulich@...e.com>

---
 arch/x86/include/asm/kdebug.h  |    1 -
 arch/x86/kernel/dumpstack.c    |    2 +-
 arch/x86/kernel/dumpstack_32.c |    2 +-
 arch/x86/kernel/dumpstack_64.c |    2 +-
 arch/x86/kernel/kprobes.c      |    4 ++--
 arch/x86/kernel/nmi.c          |    2 +-
 arch/x86/kernel/process.c      |    6 ------
 7 files changed, 6 insertions(+), 13 deletions(-)

--- 3.2-rc3/arch/x86/include/asm/kdebug.h
+++ 3.2-rc3-x86-no-show_registers/arch/x86/include/asm/kdebug.h
@@ -24,7 +24,6 @@ enum die_val {
 extern void printk_address(unsigned long address, int reliable);
 extern void die(const char *, struct pt_regs *,long);
 extern int __must_check __die(const char *, struct pt_regs *, long);
-extern void show_registers(struct pt_regs *regs);
 extern void show_trace(struct task_struct *t, struct pt_regs *regs,
 		       unsigned long *sp, unsigned long bp);
 extern void __show_regs(struct pt_regs *regs, int all);
--- 3.2-rc3/arch/x86/kernel/dumpstack.c
+++ 3.2-rc3-x86-no-show_registers/arch/x86/kernel/dumpstack.c
@@ -267,7 +267,7 @@ int __kprobes __die(const char *str, str
 			current->thread.trap_no, SIGSEGV) == NOTIFY_STOP)
 		return 1;
 
-	show_registers(regs);
+	show_regs(regs);
 #ifdef CONFIG_X86_32
 	if (user_mode_vm(regs)) {
 		sp = regs->sp;
--- 3.2-rc3/arch/x86/kernel/dumpstack_32.c
+++ 3.2-rc3-x86-no-show_registers/arch/x86/kernel/dumpstack_32.c
@@ -82,7 +82,7 @@ show_stack_log_lvl(struct task_struct *t
 }
 
 
-void show_registers(struct pt_regs *regs)
+void show_regs(struct pt_regs *regs)
 {
 	int i;
 
--- 3.2-rc3/arch/x86/kernel/dumpstack_64.c
+++ 3.2-rc3-x86-no-show_registers/arch/x86/kernel/dumpstack_64.c
@@ -245,7 +245,7 @@ show_stack_log_lvl(struct task_struct *t
 	show_trace_log_lvl(task, regs, sp, bp, log_lvl);
 }
 
-void show_registers(struct pt_regs *regs)
+void show_regs(struct pt_regs *regs)
 {
 	int i;
 	unsigned long sp;
--- 3.2-rc3/arch/x86/kernel/kprobes.c
+++ 3.2-rc3-x86-no-show_registers/arch/x86/kernel/kprobes.c
@@ -1092,9 +1092,9 @@ int __kprobes longjmp_break_handler(stru
 			       "current sp %p does not match saved sp %p\n",
 			       stack_addr(regs), kcb->jprobe_saved_sp);
 			printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
-			show_registers(saved_regs);
+			show_regs(saved_regs);
 			printk(KERN_ERR "Current registers\n");
-			show_registers(regs);
+			show_regs(regs);
 			BUG();
 		}
 		*regs = kcb->jprobe_saved_regs;
--- 3.2-rc3/arch/x86/kernel/nmi.c
+++ 3.2-rc3-x86-no-show_registers/arch/x86/kernel/nmi.c
@@ -244,7 +244,7 @@ io_check_error(unsigned char reason, str
 	pr_emerg(
 	"NMI: IOCK error (debug interrupt?) for reason %02x on CPU %d.\n",
 		 reason, smp_processor_id());
-	show_registers(regs);
+	show_regs(regs);
 
 	if (panic_on_io_nmi)
 		panic("NMI IOCK error: Not continuing");
--- 3.2-rc3/arch/x86/kernel/process.c
+++ 3.2-rc3-x86-no-show_registers/arch/x86/kernel/process.c
@@ -84,12 +84,6 @@ void exit_thread(void)
 	}
 }
 
-void show_regs(struct pt_regs *regs)
-{
-	show_registers(regs);
-	show_trace(NULL, regs, (unsigned long *)kernel_stack_pointer(regs), 0);
-}
-
 void show_regs_common(void)
 {
 	const char *vendor, *product, *board;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ