* [PATCH for 2.6.30] ptrace: revert "ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic"
[not found] ` <20090602011318.GA2461@redhat.com>
@ 2009-06-02 20:39 ` Oleg Nesterov
2009-06-02 20:55 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-06-02 20:39 UTC (permalink / raw)
To: Andrew Morton, Roland McGrath
Cc: Jan Kratochvil, Denys Vlasenko, linux-kernel
Commit 95a3540da9c81a5987be810e1d9a83640a366bd5 removed the "extra"
wake_up_process() from ptrace_detach(), but as Jan pointed out this breaks
the compatibility.
I believe the changelog is right and this wake_up() is wrong in many ways.
But GDB assumes that ptrace(PTRACE_DETACH, child, 0, 0) always wakes up the
tracee. Despite the fact this breaks SIGNAL_STOP_STOPPED/group_stop_count logic,
and despite the fact this wake_up_process() can break another assumption:
PTRACE_DETACH with SIGSTOP should leave the tracee in TASK_STOPPED case.
Because the untraced child can dequeue SIGSTOP and call do_signal_stop()
before ptrace_detach() calls wake_up_process().
Revert this change for now. We need some fixes even if we we want to keep
the current behaviour, but these fixes are not for 2.6.30.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -304,6 +304,8 @@ int ptrace_detach(struct task_struct *ch
if (child->ptrace) {
child->exit_code = data;
dead = __ptrace_detach(current, child);
+ if (!child->exit_state)
+ wake_up_process(child);
}
write_unlock_irq(&tasklist_lock);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH for 2.6.30] ptrace: revert "ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic"
2009-06-02 20:39 ` [PATCH for 2.6.30] ptrace: revert "ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic" Oleg Nesterov
@ 2009-06-02 20:55 ` Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2009-06-02 20:55 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, Jan Kratochvil, Denys Vlasenko, linux-kernel
Acked-by: Roland McGrath <roland@redhat.com>
Indeed the old code was highly suspect and we need more work to fix it.
But this was not a conservative change and it did produce regressions.
It's better to leave old-and-wrong as it was until we have finished
more thorough revamp work.
Thanks,
Roland
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-02 20:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090529103017.D548FFC2BD@magilla.sf.frob.com>
[not found] ` <20090529125405.GD19812@redhat.com>
[not found] ` <20090529143049.GA27424@redhat.com>
[not found] ` <20090530202313.GA12066@host0.dyn.jankratochvil.net>
[not found] ` <20090530234449.GA31604@redhat.com>
[not found] ` <20090601014258.E3EA2FC3C7@magilla.sf.frob.com>
[not found] ` <20090602011318.GA2461@redhat.com>
2009-06-02 20:39 ` [PATCH for 2.6.30] ptrace: revert "ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic" Oleg Nesterov
2009-06-02 20:55 ` Roland McGrath
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.