aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@us.ibm.com>2006-12-08 05:38:01 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:52 -0500
commit84d737866e2babdeab0c6b18ea155c6a649663b8 (patch)
treee504da826174c2804d8c680828800aa680090686 /fs
parent6cc1b22a4acef3816eaa5f8c227d93d749b23195 (diff)
[PATCH] add child reaper to pid_namespace
Add a per pid_namespace child-reaper. This is needed so processes are reaped within the same pid space and do not spill over to the parent pid space. Its also needed so containers preserve existing semantic that pid == 1 would reap orphaned children. This is based on Eric Biederman's patch: http://lkml.org/lkml/2006/2/6/285 Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 60433e2254a4..12d8cd461b41 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -38,6 +38,7 @@
38#include <linux/binfmts.h> 38#include <linux/binfmts.h>
39#include <linux/swap.h> 39#include <linux/swap.h>
40#include <linux/utsname.h> 40#include <linux/utsname.h>
41#include <linux/pid_namespace.h>
41#include <linux/module.h> 42#include <linux/module.h>
42#include <linux/namei.h> 43#include <linux/namei.h>
43#include <linux/proc_fs.h> 44#include <linux/proc_fs.h>
@@ -620,8 +621,8 @@ static int de_thread(struct task_struct *tsk)
620 * Reparenting needs write_lock on tasklist_lock, 621 * Reparenting needs write_lock on tasklist_lock,
621 * so it is safe to do it under read_lock. 622 * so it is safe to do it under read_lock.
622 */ 623 */
623 if (unlikely(tsk->group_leader == child_reaper)) 624 if (unlikely(tsk->group_leader == child_reaper(tsk)))
624 child_reaper = tsk; 625 tsk->nsproxy->pid_ns->child_reaper = tsk;
625 626
626 zap_other_threads(tsk); 627 zap_other_threads(tsk);
627 read_unlock(&tasklist_lock); 628 read_unlock(&tasklist_lock);