Commit 479bf98c1c29b40d86e40a4e6e4944c2f03d9493

Authored by Oleg Nesterov
1 parent bb3696da89

ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/

wait_consider_task() checks same_thread_group(parent, real_parent),
this is the open-coded ptrace_reparented().

__ptrace_detach() remains the only function which has to check this by
hand, although we could reorganize the code to delay __ptrace_unlink.

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

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

... ... @@ -1599,8 +1599,7 @@
1599 1599 * own children, it should create a separate process which
1600 1600 * takes the role of real parent.
1601 1601 */
1602   - if (likely(!ptrace) && p->ptrace &&
1603   - same_thread_group(p->parent, p->real_parent))
  1602 + if (likely(!ptrace) && p->ptrace && !ptrace_reparented(p))
1604 1603 return 0;
1605 1604  
1606 1605 /*