OpenVZ Forum


Home » Mailing lists » Devel » Add pid_namespace to nsproxy
Add pid_namespace to nsproxy [message #16624] Fri, 08 September 2006 05:41 Go to previous message
Sukadev Bhattiprolu is currently offline  Sukadev Bhattiprolu
Messages: 413
Registered: August 2006
Senior Member
Add a notion of pid namespace to nsproxy (and by extension, to task_struct).
Currently there is only one pid namespace, init_pid_ns and all tasks belong
to this pid namespace. When a new task is created, it inherits its parent's
pid namespace (in copy_process()).

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>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: containers@lists.osdl.org

 include/linux/init_task.h |    2 ++
 include/linux/nsproxy.h   |    1 +
 2 files changed, 3 insertions(+)

Index: lx26-18-rc5-mm1/include/linux/init_task.h
===================================================================
--- lx26-18-rc5-mm1.orig/include/linux/init_task.h	2006-09-07 22:21:06.000000000 -0700
+++ lx26-18-rc5-mm1/include/linux/init_task.h	2006-09-07 22:29:58.000000000 -0700
@@ -7,6 +7,7 @@
 #include <linux/utsname.h>
 #include <linux/lockdep.h>
 #include <linux/ipc.h>
+#include <linux/pid_namespace.h>
 
 #define INIT_FDTABLE \
 {							\
@@ -72,6 +73,7 @@
 
 extern struct nsproxy init_nsproxy;
 #define INIT_NSPROXY(nsproxy) {						\
+	.pid_ns		= &init_pid_ns,					\
 	.count		= ATOMIC_INIT(1),				\
 	.nslock		= SPIN_LOCK_UNLOCKED,				\
 	.uts_ns		= &init_uts_ns,					\
Index: lx26-18-rc5-mm1/include/linux/nsproxy.h
===================================================================
--- lx26-18-rc5-mm1.orig/include/linux/nsproxy.h	2006-09-07 22:21:06.000000000 -0700
+++ lx26-18-rc5-mm1/include/linux/nsproxy.h	2006-09-07 22:30:22.000000000 -0700
@@ -23,6 +23,7 @@ struct ipc_namespace;
 struct nsproxy {
 	atomic_t count;
 	spinlock_t nslock;
+	struct pid_namespace *pid_ns;
 	struct uts_namespace *uts_ns;
 	struct ipc_namespace *ipc_ns;
 	struct namespace *namespace;
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [ckrm-tech] [PATCH] BC: resource beancounters (v4) (added user memory)
Next Topic: [PATCH] IA64,sparc: local DoS with corrupted ELFs
Goto Forum:
  


Current Time: Wed Aug 27 22:51:36 GMT 2025

Total time taken to generate the page: 0.18514 seconds