PTRACE_SINGLESTEP after syscall-exit shouldn't trigger the trap before
return to user-mode. This was the x86 spicific oddity which is already
fixed in -mm by
ptrace-x86-change-syscall_trace_leave-to-rely-on-tracehook-when-stepping.patch

---

 kernel/ptrace.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- PU/kernel/ptrace.c~131_SYSCALL_EXIT_DONT_TRAP       2009-11-13 
22:34:23.000000000 +0100
+++ PU/kernel/ptrace.c  2009-11-13 22:35:40.000000000 +0100
@@ -940,10 +940,7 @@ static int ptrace_resume(struct task_str
                        do_ptrace_notify_stop(ctx, tracee);
                        return 0;
                }
-               /* fallthrough, but suppress send_sig_info() below */
-               data = 0;
 
-       case PTRACE_EVENT_SYSCALL_EXIT:
                if (action != UTRACE_RESUME) {
                        /*
                         * single-stepping. UTRACE_SIGNAL_REPORT will
@@ -952,8 +949,9 @@ static int ptrace_resume(struct task_str
                        ctx->signr = SIGTRAP;
                        action = UTRACE_INTERRUPT;
                }
-               /* fallthrough */
+               break;
 
+       case PTRACE_EVENT_SYSCALL_EXIT:
        case PTRACE_EVENT_SYSCALL_ENTRY:
                if (data)
                        send_sig_info(data, SEND_SIG_PRIV, tracee);

Reply via email to