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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Dec 2012 10:18:54 -0800
From:	Joe Perches <joe@...ches.com>
To:	Jiri Kosina <trivial@...nel.org>
Cc:	Haavard Skinnemoen <hskinnemoen@...il.com>,
	Hans-Christian Egtvedt <egtvedt@...fundet.no>,
	linux-kernel@...r.kernel.org
Subject: [TRIVIAL PATCH 05/26] avr32: Convert print_symbol to %pSR

Use the new vsprintf extension to avoid any possible
message interleaving.

Remove a couple of #ifdef CONFIG_KALLSYMS branches
that are now the same code.

Signed-off-by: Joe Perches <joe@...ches.com>
---
 arch/avr32/kernel/process.c |   25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index fd78f58..7a56e86 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -148,12 +148,7 @@ static void show_trace_log_lvl(struct task_struct *tsk, unsigned long *sp,
 		unsigned long new_fp;
 
 		lr = *(unsigned long *)fp;
-#ifdef CONFIG_KALLSYMS
-		printk("%s [<%08lx>] ", log_lvl, lr);
-#else
-		printk(" [<%08lx>] ", lr);
-#endif
-		print_symbol("%s\n", lr);
+		printk("%s [<%08lx>] %pSR\n", log_lvl, lr, (void *)lr);
 
 		new_fp = *(unsigned long *)(fp + 4);
 		if (new_fp <= fp)
@@ -172,14 +167,9 @@ static void show_trace_log_lvl(struct task_struct *tsk, unsigned long *sp,
 
 	while (!kstack_end(sp)) {
 		addr = *sp++;
-		if (kernel_text_address(addr)) {
-#ifdef CONFIG_KALLSYMS
-			printk("%s [<%08lx>] ", log_lvl, addr);
-#else
-			printk(" [<%08lx>] ", addr);
-#endif
-			print_symbol("%s\n", addr);
-		}
+		if (kernel_text_address(addr))
+			printk("%s [<%08lx>] %pSR\n",
+			       log_lvl, addr, (void *)addr);
 	}
 	printk("\n");
 }
@@ -235,10 +225,9 @@ void show_regs_log_lvl(struct pt_regs *regs, const char *log_lvl)
 	if (!user_mode(regs)) {
 		sp = (unsigned long)regs + FRAME_SIZE_FULL;
 
-		printk("%s", log_lvl);
-		print_symbol("PC is at %s\n", instruction_pointer(regs));
-		printk("%s", log_lvl);
-		print_symbol("LR is at %s\n", lr);
+		printk("%sPC is at %pSR\n",
+		       log_lvl, (void *)instruction_pointer(regs));
+		printk("%sLR is at %pSR\n", log_lvl, (void *)lr);
 	}
 
 	printk("%spc : [<%08lx>]    lr : [<%08lx>]    %s\n"
-- 
1.7.8.112.g3fd21

--
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