ptrace: revert "ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic"
authorOleg Nesterov <oleg@redhat.com>
Thu, 4 Jun 2009 23:29:09 +0000 (16:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Jun 2009 01:07:40 +0000 (18:07 -0700)
commitedaba2c5334492f82d39ec35637c6dea5176a977
treed05ee0eacdb0c725da8374e9c1f38a4808dfdd2e
parent08f67461c609ad96bf26732b590569e02e322019
ptrace: revert "ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic"

Commit 95a3540da9c81a5987be810e1d9a83640a366bd5 ("ptrace_detach: the wrong
wakeup breaks the ERESTARTxxx logic") 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>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/ptrace.c