lkml.org 
[lkml]   [2006]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH rc1-mm 2/3] coredump: shutdown current process first
From
Date
Oleg Nesterov <oleg@tv-sign.ru> writes:

> On 04/10, Roland McGrath wrote:
>>
>> I would be inclined to restructure the inner loop something like this:
>>
>> p = g;
>> while (unlikely(p->mm == NULL)) {
>> p = next_thread(p);
>> if (p == g)
>> break;
>> }
>> if (p->mm == mm) {
>> /*
>> * p->sighand can't disappear, but
>> * may be changed by de_thread()
>> */
>> lock_task_sighand(p, &flags);
>> zap_process(p);
>> unlock_task_sighand(p, &flags);
>> }
>
> Yes, I agree, this is much more understandable.

There is one piece of zap_threads that still makes me uncomfortable.

task_lock is used to protect p->mm.
Therefore killing a process based upon p->mm == mm is racy
with respect to sys_unshare I believe if we don't take
task_lock.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-14 10:13    [W:0.143 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site