OpenVZ Forum


Home » Mailing lists » Devel » Re: [RFC][PATCH] Add child reaper to struct pspace
Re: [RFC][PATCH] Add child reaper to struct pspace [message #6056] Thu, 07 September 2006 11:41 Go to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Cedric Le Goater wrote:
> Sukadev Bhattiprolu wrote:
>
> <snip>
>
>>@@ -620,8 +620,8 @@ static int de_thread(struct task_struct
>> * Reparenting needs write_lock on tasklist_lock,
>> * so it is safe to do it under read_lock.
>> */
>>- if (unlikely(current->group_leader == child_reaper))
>>- child_reaper = current;
>>+ if (unlikely(current->group->leader == current->pspace->child_reaper)
>>+ current->pspace->child_reaper = current;
>>
>> zap_other_threads(current);
>> read_unlock(&tasklist_lock);
>
>
> I'm unsure about this one ?
AFAICS, this one is for multithreaded init?
looks ok, imho.

Thanks,
Kirill
Re: [RFC][PATCH] Add child reaper to struct pspace [message #6084 is a reply to message #6056] Thu, 07 September 2006 19:38 Go to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
Kirill Korotaev <dev@sw.ru> writes:

> Cedric Le Goater wrote:
>> Sukadev Bhattiprolu wrote:
>>
>> <snip>
>>
>>>@@ -620,8 +620,8 @@ static int de_thread(struct task_struct
>>> * Reparenting needs write_lock on tasklist_lock,
>>> * so it is safe to do it under read_lock.
>>> */
>>>- if (unlikely(current->group_leader == child_reaper))
>>>- child_reaper = current;
>>>+ if (unlikely(current->group->leader == current->pspace->child_reaper)
>>>+ current->pspace->child_reaper = current;
>>>
>>> zap_other_threads(current);
>>> read_unlock(&tasklist_lock);
>>
>>
>> I'm unsure about this one ?
> AFAICS, this one is for multithreaded init?
> looks ok, imho.

Correct except for the lack of nsproxy.

The case to think about is when a multi-threaded init exec a
process for a thread where pid != tgid.

It prevents from having problems with an untrusted init process.


Eric
Previous Topic: [RFC][PATCH] Add pspace to task_struct
Next Topic: Re: pspace name
Goto Forum:
  


Current Time: Sat Nov 09 17:17:40 GMT 2024

Total time taken to generate the page: 0.03183 seconds