OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH 6/6]: Enable unsharing pid namespace.
Re: [RFC][PATCH 6/6]: Enable unsharing pid namespace. [message #17773 is a reply to message #17657] Tue, 13 March 2007 09:01 Go to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
Cedric Le Goater <clg@fr.ibm.com> writes:

>> | > Index: lx26-20-mm2b/kernel/nsproxy.c
>> | > ===================================================================
>> | > --- lx26-20-mm2b.orig/kernel/nsproxy.c 2007-03-09 14:56:12.000000000 -0800
>> | > +++ lx26-20-mm2b/kernel/nsproxy.c	2007-03-09 15:03:05.000000000 -0800
>> | > @@ -83,13 +83,16 @@ int copy_namespaces(int flags, struct ta
>> | >  	struct nsproxy *old_ns = tsk->nsproxy;
>> | >  	struct nsproxy *new_ns;
>> | >  	int err = 0;
>> | > +	int ns_all;
>> | >  
>> | >  	if (!old_ns)
>> | >  		return 0;
>> | >  
>> | >  	get_nsproxy(old_ns);
>> | >  
>> | > -	if (!(flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC)))
>> | > +	ns_all = CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC | CLONE_NEWPID;
>> | > +
>> | 
>> | This doesn't quite seem to make sense why the extra intermediate variable?
>> 
>> Will drop ns_all variable.
>
> well, in the patch reserving the pid namespace clone flags, 
> we could define : 
>
> #define NS_ALL	(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWPID)
>
> which is useful in many ways.

Yes.  Especially if we structured it something like:

#ifdef CONFIG_PID_NS
#define CLONE_NEWPID_NSALL CLONE_NEWPID
#else
#define CLONE_NEWPID_NSALL
#endif

#define NS_ALL	(CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWPID_NSALL)

So we have a natural way of disabling the pid namespace, until we are certain
it is complete and remove it from CONFIG_EXPERIMENTAL

Eric
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RFC][PATCH 3/6] pid namespace : use struct pid_nr
Next Topic: [RFC] ns containers (v2): namespace entering
Goto Forum:
  


Current Time: Wed Aug 13 04:14:34 GMT 2025

Total time taken to generate the page: 0.35638 seconds