sparc64: Make corrupted user stacks more debuggable.
authorDavid Miller <davem@redhat.com>
Fri, 26 Oct 2018 03:36:46 +0000 (20:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:50:54 +0000 (14:50 +0100)
commitd7f58d5f2cdbd5a12f3f6b71606f374353f07cf9
treefa30f089ef73f2634d266324f2efa044b89aeea6
parent9b5bc99b10e8260b5fe4fab3a143869c50e7aea3
sparc64: Make corrupted user stacks more debuggable.

[ Upstream commit 5b4fc3882a649c9411dd0dcad2ddb78e911d340e ]

Right now if we get a corrupted user stack frame we do a
do_exit(SIGILL) which is not helpful.

If under a debugger, this behavior causes the inferior process to
exit.  So the register and other state cannot be examined at the time
of the event.

Instead, conditionally log a rate limited kernel log message and then
force a SIGSEGV.

With bits and ideas borrowed (as usual) from powerpc.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/include/asm/switch_to_64.h
arch/sparc/kernel/process_64.c
arch/sparc/kernel/rtrap_64.S
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_64.c