Re: [PATCH 1/2] signals: kill(-1) should only signal processes in the same namespace

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric W. Biederman
Date: Thursday, July 17, 2008 - 10:45 am

"Daniel Hokka Zakrisson" <daniel@hozac.com> writes:


Can you please introduce kill_pidns_info and have both
kill_something_info and zap_pid_ns_processes call this common
function?

We want to walk the set of all pids in a pid namespace.  /proc does
this and it is the recommended idiom.  If walking all of the pids in a
pid namespace is not fast enough we can accelerate that.

You are correct signalling every thread in a namespace is worse, in
fact it is semantically incorrect.  zap_pid_ns_processes gets away
with it because it is sending SIGKILL.   Therefore kill_pidns_info 
should skip sending a signal to every task that is not the
thread_group_leader.

We need to hold the tasklist_lock to prevent new processes from
joining the list of all processes.  Otherwise we could run the code
under the rcu_read_lock.

Eric
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] signals: kill(-1) should only signal processes ..., Daniel Hokka Zakrisson, (Thu Jul 17, 7:55 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Daniel Hokka Zakrisson, (Thu Jul 17, 8:24 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Eric W. Biederman, (Thu Jul 17, 10:45 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Eric W. Biederman, (Thu Jul 17, 10:50 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Daniel Hokka Zakrisson, (Thu Jul 17, 11:39 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Daniel Hokka Zakrisson, (Thu Jul 17, 11:44 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Eric W. Biederman, (Thu Jul 17, 11:45 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Eric W. Biederman, (Thu Jul 17, 11:46 am)
Re: [PATCH 1/2] signals: kill(-1) should only signal proce ..., Daniel Hokka Zakrisson, (Wed Jul 23, 9:09 am)