[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m18wxua2tv.fsf@frodo.ebiederm.org>
Date: Wed, 28 May 2008 08:03:08 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Atsushi TSUJI <a-tsuji@...jp.nec.com>
Cc: Oleg Nesterov <oleg@...sign.ru>, linux-kernel@...r.kernel.org,
Roland McGrath <roland@...hat.com>
Subject: Re: [PATCH] kill_something_info: don't take tasklist_lock for pid==-1 case
Atsushi TSUJI <a-tsuji@...jp.nec.com> writes:
>> Call me paranoid but I don't think there is any guarantee without a lock
>> that we will hit the -ERESTARTNOITR check for new processes. I think we
>> have a slight race where the fork process may not have received the signal
>> (because it is near the tail of the list) but the new process would be
>> added to the list immediately after we read it's pointer.
>
> I know it might happen some races, but, as Oleg say, it is no problem
> on the user side. Users cannot realize whether the process forked
> during kill or after. We can pretend it was forked after kill
> finished. So I think the change to convert tasklist_lock to
> rcu_read_lock is reasonable way to avoid the local DOS for kill(-1,sig) case.
We can only pretend that if the parent lives. If the parent is killed
then we can not so pretend.
Which in a lot of ways is the problem. kill(-1,SIGKIL) should
kill everything except for init and the process that sent the
signal. If anything else survives we have a broken the shutdown
scripts.
Since the race would rarely hit it will take ages for someone
to trace back to a kernel change.
If I could convince myself that Oleg is correct and that what
Oleg is proposing will always work I don't have a problem.
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists