Commit d25141a818383b3c3b09f065698c544a7a0ec6e7

Authored by Sukadev Bhattiprolu
Committed by Linus Torvalds
1 parent e74481e232

'kill sig -1' must only apply to caller's namespace

Currently "kill <sig> -1" kills processes in all namespaces and breaks the
isolation of namespaces.  Earlier attempt to fix this was discussed at:

	http://lkml.org/lkml/2008/7/23/148

As suggested by Oleg Nesterov in that thread, use "task_pid_vnr() > 1"
check since task_pid_vnr() returns 0 if process is outside the caller's
namespace.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Tested-by: Daniel Hokka Zakrisson <daniel@hozac.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -1144,7 +1144,8 @@
1144 1144 struct task_struct * p;
1145 1145  
1146 1146 for_each_process(p) {
1147   - if (p->pid > 1 && !same_thread_group(p, current)) {
  1147 + if (task_pid_vnr(p) > 1 &&
  1148 + !same_thread_group(p, current)) {
1148 1149 int err = group_send_sig_info(sig, info, p);
1149 1150 ++count;
1150 1151 if (err != -EPERM)