powerpc/traps: Fix the message printed when stack overflows
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 29 Jan 2019 16:37:55 +0000 (16:37 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 30 Jan 2019 12:31:44 +0000 (23:31 +1100)
Today's message is useless:

  [   42.253267] Kernel stack overflow in process (ptrval), r1=c65500b0

This patch fixes it:

  [   66.905235] Kernel stack overflow in process sh[356], r1=c65560b0

Fixes: ad67b74d2469 ("printk: hash addresses printed with %p")
Cc: stable@vger.kernel.org # v4.15+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Use task_pid_nr()]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/traps.c

index 5e917a84f949a7dd5d142bf5e8e4a5921b53ca9c..040b602936132ecf10bed914dcb428669f90a9bc 100644 (file)
@@ -1535,8 +1535,8 @@ bail:
 
 void StackOverflow(struct pt_regs *regs)
 {
-       printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
-              current, regs->gpr[1]);
+       pr_crit("Kernel stack overflow in process %s[%d], r1=%lx\n",
+               current->comm, task_pid_nr(current), regs->gpr[1]);
        debugger(regs);
        show_regs(regs);
        panic("kernel stack overflow");