diff options
author | David Miller <davem@redhat.com> | 2018-10-25 20:36:46 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-26 15:04:41 -0700 |
commit | 5b4fc3882a649c9411dd0dcad2ddb78e911d340e (patch) | |
tree | 1e4d71d14473c440a48f1fbfdcd465cf478fc2f4 /arch/sparc/kernel/signal_64.c | |
parent | caf539cd1087f7c36b9c4df271575e9aee49fde5 (diff) |
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/signal_64.c')
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 48366e5eb5b2..e9de1803a22e 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c @@ -370,7 +370,11 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) get_sigframe(ksig, regs, sf_size); if (invalid_frame_pointer (sf)) { - do_exit(SIGILL); /* won't return, actually */ + if (show_unhandled_signals) + pr_info("%s[%d] bad frame in setup_rt_frame: %016lx TPC %016lx O7 %016lx\n", + current->comm, current->pid, (unsigned long)sf, + regs->tpc, regs->u_regs[UREG_I7]); + force_sigsegv(ksig->sig, current); return -EINVAL; } |