Skip to content

Commit

Permalink
m68k: Remove ptrace_signal_deliver
Browse files Browse the repository at this point in the history
This fixes debugger syscall restart interactions.  A debugger that
modifies the tracee's program counter is expected to set the orig_d0
pseudo register to -1, to disable a possible syscall restart.

This removes the last user of the ptrace_signal_deliver hook in the ptrace
signal handling, so remove that as well.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
  • Loading branch information
Andreas Schwab authored and Geert Uytterhoeven committed Jun 19, 2017
1 parent 1072734 commit 204a2be
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
5 changes: 0 additions & 5 deletions arch/m68k/include/asm/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,4 @@ static inline int __gen_sigismember(sigset_t *set, int _sig)

#endif /* !CONFIG_CPU_HAS_NO_BITFIELDS */

#ifndef __uClinux__
extern void ptrace_signal_deliver(void);
#define ptrace_signal_deliver ptrace_signal_deliver
#endif /* __uClinux__ */

#endif /* _M68K_SIGNAL_H */
16 changes: 0 additions & 16 deletions arch/m68k/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,6 @@ int fixup_exception(struct pt_regs *regs)
return 1;
}

void ptrace_signal_deliver(void)
{
struct pt_regs *regs = signal_pt_regs();
if (regs->orig_d0 < 0)
return;
switch (regs->d0) {
case -ERESTARTNOHAND:
case -ERESTARTSYS:
case -ERESTARTNOINTR:
regs->d0 = regs->orig_d0;
regs->orig_d0 = -1;
regs->pc -= 2;
break;
}
}

static inline void push_cache (unsigned long vaddr)
{
/*
Expand Down
4 changes: 0 additions & 4 deletions include/linux/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,6 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
#define current_pt_regs() task_pt_regs(current)
#endif

#ifndef ptrace_signal_deliver
#define ptrace_signal_deliver() ((void)0)
#endif

/*
* unlike current_pt_regs(), this one is equal to task_pt_regs(current)
* on *all* architectures; the only reason to have a per-arch definition
Expand Down
1 change: 0 additions & 1 deletion kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,6 @@ static void do_jobctl_trap(void)

static int ptrace_signal(int signr, siginfo_t *info)
{
ptrace_signal_deliver();
/*
* We do not check sig_kernel_stop(signr) but set this marker
* unconditionally because we do not know whether debugger will
Expand Down

0 comments on commit 204a2be

Please sign in to comment.