Re: [PATCH v2] lib_backtrace: fix kernel text address leak

From: Liu, Changcheng
Date: Mon Nov 06 2017 - 11:57:07 EST


Don't leak idle function address in NMI backtrace.

Signed-off-by: Liu Changcheng <changcheng.liu@xxxxxxxxx>

diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index 46e4c749..61a6b5a 100644
--- a/lib/nmi_backtrace.c
+++ b/lib/nmi_backtrace.c
@@ -93,8 +93,8 @@ bool nmi_cpu_backtrace(struct pt_regs *regs)
if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
arch_spin_lock(&lock);
if (regs && cpu_in_idle(instruction_pointer(regs))) {
- pr_warn("NMI backtrace for cpu %d skipped: idling at pc %#lx\n",
- cpu, instruction_pointer(regs));
+ pr_warn("NMI backtrace for cpu %d skipped: idling at %pS\n",
+ cpu, (void *)instruction_pointer(regs));
} else {
pr_warn("NMI backtrace for cpu %d\n", cpu);
if (regs)
--
2.7.4