]> git.baikalelectronics.ru Git - kernel.git/commit
__ptrace_detach: avoid task_detached(), check do_notify_parent()
authorOleg Nesterov <oleg@redhat.com>
Wed, 22 Jun 2011 21:08:53 +0000 (23:08 +0200)
committerOleg Nesterov <oleg@redhat.com>
Mon, 27 Jun 2011 18:30:08 +0000 (20:30 +0200)
commit3017e77bec70b8cdba52895071662ceffd0304af
tree8c3d8a77ed8b2a021451a493aa47162977c8001b
parent08f22fb63698f7d71ffa5d5f57fbd841091a8124
__ptrace_detach: avoid task_detached(), check do_notify_parent()

__ptrace_detach() relies on the current obscure behaviour of
do_notify_parent(tsk) which changes tsk->exit_signal if this child
should be silently reaped. That is why we check task_detached(), it
is true if the task is sub-thread, or it is the group_leader but
its exit_signal was changed by do_notify_parent().

This is confusing, change the code to rely on !thread_group_leader()
or the value returned by do_notify_parent().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
kernel/ptrace.c