Messages in this thread | | | Date | Fri, 8 Apr 2011 20:55:31 +0200 | From | Oleg Nesterov <> | Subject | Re: [path][rfc] add PR_DETACH prctl command |
| |
On 04/08, Stas Sergeev wrote: > > I updated patch to fix the race between wait_task_detached() > and wait_task_zombie() by using is_detaching flag. > Here's the patch. > What problems do remain here?
Stas, sorry, I simply have no time to read this patch. Not to mention, you know that I dislike it in any case.
I only quickly looked at the changes in sys_prctl and they are definitely wrong.
> + me->real_parent = pid_ns->child_reaper; > + if (thread_group_leader(me)) { > + list_move_tail(&me->sibling, > + &me->real_parent->children); > + /* reparent threads */ > + p = me; > + while_each_thread(me, p) { > + if (!task_ptrace(p)) > + p->parent = pid_ns->child_reaper; > + p->real_parent = pid_ns->child_reaper;
Why do you check thread_group_leader() ???? What if the caller is not the leader?
I told this many times, and I got lost. If you reparent, you should always reparent the whole group.
Also, you are doing do_signal_parent(me). I do not know what it does (once again, I didn't read the patch), but this looks suspicious. A sub-thread shouldn't notify the parent.
Oleg.
| |