From 6b5c8045ecc7e726cdaa2a9d9c8e5008050e1252 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 2 May 2012 21:02:03 -0400 Subject: arm: new way of handling ERESTART_RESTARTBLOCK new "syscall start" flag; handled in syscall_trace() by switching syscall number to that of syscall_restart(2). Restarts of that kind (ERESTART_RESTARTBLOCK) are handled by setting that bit; syscall number is not modified until the actual call. Signed-off-by: Al Viro --- arch/arm/kernel/ptrace.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/kernel/ptrace.c') diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 9650c143afc..d407ebf4180 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -916,6 +917,8 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); + if (why == 0 && test_and_clear_thread_flag(TIF_SYSCALL_RESTARTSYS)) + scno = __NR_restart_syscall - __NR_SYSCALL_BASE; if (!test_thread_flag(TIF_SYSCALL_TRACE)) return scno; if (!(current->ptrace & PT_PTRACED)) -- cgit v1.2.3 From 70b58d896b1b30e4b89d369fbeb244c0e952cf9f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 19 May 2012 14:27:27 -0400 Subject: arm: don't open-code ptrace_report_syscall() Signed-off-by: Al Viro --- arch/arm/kernel/ptrace.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'arch/arm/kernel/ptrace.c') diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index d407ebf4180..688a0a970c7 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -932,20 +932,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) */ ip = regs->ARM_ip; regs->ARM_ip = why; - - /* the 0x80 provides a way for the tracing parent to distinguish - between a syscall stop and SIGTRAP delivery */ - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) - ? 0x80 : 0)); - /* - * this isn't the same as continuing with a signal, but it will do - * for normal use. strace only continues with a signal if the - * stopping signal is not SIGTRAP. -brl - */ - if (current->exit_code) { - send_sig(current->exit_code, current, 1); - current->exit_code = 0; - } + ptrace_report_syscall(regs); regs->ARM_ip = ip; return current_thread_info()->syscall; -- cgit v1.2.3