Messages in this thread | | | Date | Thu, 21 Apr 2011 22:15:37 +0200 | From | Oleg Nesterov <> | Subject | Re: [path][rfc] add PR_DETACH prctl command [2/2] |
| |
On 04/21, Stas Sergeev wrote: > > Attaching the fixed patch. > Changes: > - in wait_task_consider(), pr_detach hides the process > only in !ptrace case > ... > @@ -1555,6 +1600,14 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, > if (p->exit_state == EXIT_ZOMBIE && !delay_group_leader(p)) > return wait_task_zombie(wo, p); > > + if (unlikely(p->pr_detached)) { > + if (p->detaching) > + return wait_task_detached(wo, p); > + /* pr_detached tasks are hidden from parent */ > + if (!ptrace) > + return 0; > + }
Hmm... I guess this should fix ptrace? How? I dont understand this at all.
Stas, I bet you didn't test your patch. If the old parent traces the child WEXITED should not succeed until the child really exits. Otherwise it is easy to escape ptrace.
Oh. And I bet there are other problems. Say, exec can change the leader... Easy to fix, but note that we need more and more stupid pr_detached special cases.
Stas, sorry. I am not going to looks at the next versions. Until you convince lkml we need this feature.
Oleg.
| |