* [PATCH] m68k: remove ptrace_signal_deliver
@ 2017-06-06 22:11 Andreas Schwab
2017-06-12 7:40 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2017-06-06 22:11 UTC (permalink / raw)
To: linux-m68k; +Cc: linux-kernel
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>
---
arch/m68k/include/asm/signal.h | 5 -----
arch/m68k/kernel/signal.c | 16 ----------------
include/linux/ptrace.h | 4 ----
kernel/signal.c | 1 -
4 files changed, 26 deletions(-)
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h
index 8c8ce5e1ee..3bc64d02ba 100644
--- a/arch/m68k/include/asm/signal.h
+++ b/arch/m68k/include/asm/signal.h
@@ -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 */
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index 093b7c42fb..098fa7185b 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -109,22 +109,6 @@ int handle_kernel_fault(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)
{
/*
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 422bc2e4cb..9a2e04be06 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -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
diff --git a/kernel/signal.c b/kernel/signal.c
index 7e59ebc2c2..742c08b409 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -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
--
2.13.1
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] m68k: remove ptrace_signal_deliver
2017-06-06 22:11 [PATCH] m68k: remove ptrace_signal_deliver Andreas Schwab
@ 2017-06-12 7:40 ` Geert Uytterhoeven
2017-06-19 17:45 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-06-12 7:40 UTC (permalink / raw)
To: Roland McGrath, Oleg Nesterov, Al Viro
Cc: Andreas Schwab, Linux/m68k, linux-kernel
Hi Roland, Oleg, Al,
If you don't mind, I plan to queue this up in the m68k tree for v4.13.
There are no conflicts with current linux-next.
If you prefer to take this through a signal tree with my
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
please let me know.
Thanks!
On Wed, Jun 7, 2017 at 12:11 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> 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>
> ---
> arch/m68k/include/asm/signal.h | 5 -----
> arch/m68k/kernel/signal.c | 16 ----------------
> include/linux/ptrace.h | 4 ----
> kernel/signal.c | 1 -
> 4 files changed, 26 deletions(-)
>
> diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h
> index 8c8ce5e1ee..3bc64d02ba 100644
> --- a/arch/m68k/include/asm/signal.h
> +++ b/arch/m68k/include/asm/signal.h
> @@ -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 */
> diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
> index 093b7c42fb..098fa7185b 100644
> --- a/arch/m68k/kernel/signal.c
> +++ b/arch/m68k/kernel/signal.c
> @@ -109,22 +109,6 @@ int handle_kernel_fault(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)
> {
> /*
> diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
> index 422bc2e4cb..9a2e04be06 100644
> --- a/include/linux/ptrace.h
> +++ b/include/linux/ptrace.h
> @@ -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
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 7e59ebc2c2..742c08b409 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -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
> --
> 2.13.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] m68k: remove ptrace_signal_deliver
2017-06-12 7:40 ` Geert Uytterhoeven
@ 2017-06-19 17:45 ` Geert Uytterhoeven
0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2017-06-19 17:45 UTC (permalink / raw)
To: Andreas Schwab, Roland McGrath, Oleg Nesterov, Al Viro
Cc: Linux/m68k, linux-kernel
On Mon, Jun 12, 2017 at 9:40 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> If you don't mind, I plan to queue this up in the m68k tree for v4.13.
> There are no conflicts with current linux-next.
>
> If you prefer to take this through a signal tree with my
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> please let me know.
>
> Thanks!
>
> On Wed, Jun 7, 2017 at 12:11 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> 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>
Applied and queued for v4.13.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-19 17:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 22:11 [PATCH] m68k: remove ptrace_signal_deliver Andreas Schwab
2017-06-12 7:40 ` Geert Uytterhoeven
2017-06-19 17:45 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).