[PATCH 4.19 230/280] powerpc/traps: Fix the message printed when stack overflows

From: Greg Kroah-Hartman
Date: Fri Mar 22 2019 - 08:08:27 EST

4.19-stable review patch. If anyone has any objections, please let me know.


From: Christophe Leroy <christophe.leroy@xxxxxx>

commit 9bf3d3c4e4fd82c7174f4856df372ab2a71005b9 upstream.

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@xxxxxxxxxxxxxxx # v4.15+
Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
[mpe: Use task_pid_nr()]
Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

arch/powerpc/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1545,8 +1545,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]);
panic("kernel stack overflow");