Change ptrace_detach() to use ptrace_wake_up() which provokes the unconditional wakeup for compatibility. Now utrace-ptrace passes attach-wait-on-stopped, the only test it failed compared to upstream.
This is still not exactly right, implicit detach (exit_ptrace() path) shouldn't do this, will fix tomorrow. --- kernel/ptrace.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- PU/kernel/ptrace.c~88_DETACH_USE_WAKEUP 2009-10-13 18:14:55.000000000 +0200 +++ PU/kernel/ptrace.c 2009-10-13 19:20:24.000000000 +0200 @@ -80,6 +80,9 @@ void __ptrace_link(struct task_struct *c static const struct utrace_engine_ops ptrace_utrace_ops; /* forward decl */ static int ptrace_attach_task(struct task_struct *tracee, int options); static void ptrace_abort_attach(struct task_struct *tracee); +static void ptrace_wake_up(struct utrace_engine *engine, + struct task_struct *tracee, + enum utrace_resume_action action); static struct utrace_engine *ptrace_lookup_engine(struct task_struct *tracee) { @@ -91,7 +94,6 @@ static void ptrace_detach_task(struct ta { struct utrace_engine *engine = ptrace_lookup_engine(tracee); enum utrace_resume_action action = UTRACE_DETACH; - int err; if (unlikely(IS_ERR(engine))) return; @@ -107,8 +109,6 @@ static void ptrace_detach_task(struct ta break; case PTRACE_EVENT_SIGNAL: - /* make sure do_wait() can't succeed */ - tracee->exit_code = 0; if (valid_signal(sig)) context->signr = sig; context->stop_code = 0; @@ -118,10 +118,7 @@ static void ptrace_detach_task(struct ta } } - err = utrace_control(tracee, engine, action); - WARN_ON(err && err != -EINPROGRESS && - err != -ESRCH && err != -EALREADY); - + ptrace_wake_up(engine, tracee, action); utrace_engine_put(engine); }