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 next 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
Re: Add pid_namespace to nsproxy [message #16635 is a reply to message #16624] Fri, 08 September 2006 10:30 Go to previous messageGo to next message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
Sukadev Bhattiprolu wrote:

<snip>

> +++ 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;

argh that patches conflicts with the user namespace patchset and the patch
from kirill changing namespace to mnt_namespace.

I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.

* kthread conversion patches not yet accepted by maintainers
* ro bind mount, from dave
* user beancounter, from kirill and pavel
* network namespace, from andrey
* some extra stuff from daniel (in progress)
* mnt namespace, from kirill
* pid namespace, from suka.
* user namespace, from cedric

the last 3 patches conflicts because of nsproxy. I'm going to merge them
all, and resend on the list for inclusion in -mm.

thanks,

C.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: Add pid_namespace to nsproxy [message #16644 is a reply to message #16624] Fri, 08 September 2006 17:51 Go to previous messageGo to next message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
Kirill Korotaev wrote:
> Cedric Le Goater wrote:
>> Sukadev Bhattiprolu wrote:
>>
>> <snip>
>>
>>> +++ 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;
>>
>> argh that patches conflicts with the user namespace patchset and the patch
>> from kirill changing namespace to mnt_namespace.
>>
>> I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.
>>
>> * kthread conversion patches not yet accepted by maintainers
>> * ro bind mount, from dave
>> * user beancounter, from kirill and pavel
>> * network namespace, from andrey
>> * some extra stuff from daniel (in progress)
>> * mnt namespace, from kirill
>> * pid namespace, from suka.
>> * user namespace, from cedric
> Oh, good to know.
> Is it downloadable from somewhere?
> (just in case we can provide FTP/WWW whathever you need)

thanks,

It will.

I just finished the port on rc6-mm1 and a fast compile/boot on i386, x86_64
and s390. Let us give it a first round of test.

C.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: Add pid_namespace to nsproxy [message #16646 is a reply to message #16635] Fri, 08 September 2006 17:44 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Cedric Le Goater wrote:
> Sukadev Bhattiprolu wrote:
> 
> <snip>
> 
>>+++ 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;
> 
> 
> argh that patches conflicts with the user namespace patchset and the patch
> from kirill changing namespace to mnt_namespace.
> 
> I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.
> 
> * kthread conversion patches not yet accepted by maintainers
> * ro bind mount, from dave
> * user beancounter, from kirill and pavel
> * network namespace, from andrey
> * some extra stuff from daniel (in progress)
> * mnt namespace, from kirill
> * pid namespace, from suka.
> * user namespace, from cedric
Oh, good to know.
Is it downloadable from somewhere?
(just in case we can provide FTP/WWW whathever you need)

> the last 3 patches conflicts because of nsproxy. I'm going to merge them
> all, and resend on the list for inclusion in -mm.

Thanks,
Kirill
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: Add pid_namespace to nsproxy [message #16700 is a reply to message #16646] Tue, 12 September 2006 16:31 Go to previous messageGo to next message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
>> I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.
>>
>> * kthread conversion patches not yet accepted by maintainers
>> * ro bind mount, from dave
>> * user beancounter, from kirill and pavel
>> * network namespace, from andrey
>> * some extra stuff from daniel (in progress)
>> * mnt namespace, from kirill
>> * pid namespace, from suka.
>> * user namespace, from cedric
> Oh, good to know.
> Is it downloadable from somewhere?

http://www.sr71.net/patches/2.6.18/2.6.18-rc6-mm2/2.6.18-rc6-mm2-lxc1/

It's mostly stable. you can give it a try.

thanks,


C.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: Add pid_namespace to nsproxy [message #16702 is a reply to message #16700] Tue, 12 September 2006 17:00 Go to previous messageGo to next message
Herbert Poetzl is currently offline  Herbert Poetzl
Messages: 239
Registered: February 2006
Senior Member
On Tue, Sep 12, 2006 at 06:31:54PM +0200, Cedric Le Goater wrote:
> 
> >> I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.
> >>
> >> * kthread conversion patches not yet accepted by maintainers
> >> * ro bind mount, from dave
> >> * user beancounter, from kirill and pavel
> >> * network namespace, from andrey
> >> * some extra stuff from daniel (in progress)
> >> * mnt namespace, from kirill
> >> * pid namespace, from suka.
> >> * user namespace, from cedric
> > Oh, good to know.
> > Is it downloadable from somewhere?
> 
> http://www.sr71.net/patches/2.6.18/2.6.18-rc6-mm2/2.6.18-rc6-mm2-lxc1/
> 
> It's mostly stable. you can give it a try.

great! thanks!

> thanks,
> 
> 
> C.
> _______________________________________________
> Containers mailing list
> Containers@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: Add pid_namespace to nsproxy [message #16703 is a reply to message #16624] Wed, 13 September 2006 14:16 Go to previous message
Cedric Le Goater is currently offline  Cedric Le Goater
Messages: 443
Registered: February 2006
Senior Member
Kirill Korotaev wrote:
> Cedric Le Goater wrote:
>>>> I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.
>>>>
>>>> * kthread conversion patches not yet accepted by maintainers
>>>> * ro bind mount, from dave
>>>> * user beancounter, from kirill and pavel
>>>> * network namespace, from andrey
>>>> * some extra stuff from daniel (in progress)
>>>> * mnt namespace, from kirill
>>>> * pid namespace, from suka.
>>>> * user namespace, from cedric
>>> Oh, good to know.
>>> Is it downloadable from somewhere?
>>
>> http://www.sr71.net/patches/2.6.18/2.6.18-rc6-mm2/2.6.18-rc6-mm2-lxc1/
>>
>> It's mostly stable. you can give it a try.
> thanks!
> added this info at:
> http://wiki.openvz.org/Containers

good.

I'm adding a few signed-off-by: and from: in the patches i fixed. Next
version should be cleaner.

C.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
Re: Add pid_namespace to nsproxy [message #16704 is a reply to message #16700] Wed, 13 September 2006 14:13 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Cedric Le Goater wrote:
>>>I'm maintaining a patchset on 2.6.18-rc5-mm1 with the following input.
>>>
>>>* kthread conversion patches not yet accepted by maintainers
>>>* ro bind mount, from dave
>>>* user beancounter, from kirill and pavel
>>>* network namespace, from andrey
>>>* some extra stuff from daniel (in progress)
>>>* mnt namespace, from kirill
>>>* pid namespace, from suka.
>>>* user namespace, from cedric
>>
>>Oh, good to know.
>>Is it downloadable from somewhere?
> 
> 
> http://www.sr71.net/patches/2.6.18/2.6.18-rc6-mm2/2.6.18-rc6-mm2-lxc1/
> 
> It's mostly stable. you can give it a try.
thanks!
added this info at:
http://wiki.openvz.org/Containers

Kirill
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
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: Tue Nov 19 04:33:43 GMT 2024

Total time taken to generate the page: 0.05138 seconds