Skip to content

Commit

Permalink
sparc32: signal: Fix stack trampoline for RT signals
Browse files Browse the repository at this point in the history
The stack trampoline generated by the sparc32 native version of
setup_rt_frame() calls sigreturn(), not rt_sigreturn().  This will
crash the task if it's ever used.  (glibc sets its own restorer, so
was not affected.)

The sparc64 compat implementation has the right syscall number.

This is untested; I have no way to run a sparc32 kernel.

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
bwhacks authored and davem330 committed Sep 15, 2020
1 parent 4cc8ca0 commit b6b9b67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/sparc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs,
else {
regs->u_regs[UREG_I7] = (unsigned long)(&(sf->insns[0]) - 2);

/* mov __NR_sigreturn, %g1 */
err |= __put_user(0x821020d8, &sf->insns[0]);
/* mov __NR_rt_sigreturn, %g1 */
err |= __put_user(0x82102065, &sf->insns[0]);

/* t 0x10 */
err |= __put_user(0x91d02010, &sf->insns[1]);
Expand Down

0 comments on commit b6b9b67

Please sign in to comment.