summary refs log tree commit diff
path: root/arch/sparc/kernel/rtrap_64.S
diff options
context:
space:
mode:
authorDavid Miller <davem@redhat.com>2018-10-25 20:36:46 -0700
committerDavid S. Miller <davem@davemloft.net>2018-10-26 15:04:41 -0700
commit5b4fc3882a649c9411dd0dcad2ddb78e911d340e (patch)
tree1e4d71d14473c440a48f1fbfdcd465cf478fc2f4 /arch/sparc/kernel/rtrap_64.S
parentcaf539cd1087f7c36b9c4df271575e9aee49fde5 (diff)
downloadlinux-5b4fc3882a649c9411dd0dcad2ddb78e911d340e.tar.gz
sparc64: Make corrupted user stacks more debuggable.
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>
Diffstat (limited to 'arch/sparc/kernel/rtrap_64.S')
-rw-r--r--arch/sparc/kernel/rtrap_64.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S
index 4073e2b87dd0..29aa34f11720 100644
--- a/arch/sparc/kernel/rtrap_64.S
+++ b/arch/sparc/kernel/rtrap_64.S
@@ -39,6 +39,7 @@ __handle_preemption:
 		 wrpr			%g0, RTRAP_PSTATE_IRQOFF, %pstate
 
 __handle_user_windows:
+		add			%sp, PTREGS_OFF, %o0
 		call			fault_in_user_windows
 661:		 wrpr			%g0, RTRAP_PSTATE, %pstate
 		/* If userspace is using ADI, it could potentially pass