OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 05/10] Containers(V10): Add container_clone() interface
Re: [PATCH 05/10] Containers(V10): Add container_clone() interface [message #13641 is a reply to message #13567] Thu, 31 May 2007 19:56 Go to previous message
serue is currently offline  serue
Messages: 750
Registered: February 2006
Senior Member
Quoting Andrew Morton (akpm@linux-foundation.org):
> On Tue, 29 May 2007 06:01:09 -0700 menage@google.com wrote:
>
> > This patch adds support for container_clone(), a speculative interface
> > to creating new containers intended to be used for systems such as
> > namespace unsharing.
> >
> > ...
> >
> > +
> > +static atomic_t namecnt;
> > +static void get_unused_name(char *buf)
> > +{
> > + sprintf(buf, "node%d", atomic_inc_return(&namecnt));
> > +}
>
> A stupid thing, but a sufficiently determined attacker could cause this to
> wrap.

Yeah, this was very consciously done as a "just make it work for now"
naming system. If we want to stick with this naming, then I suppose we
could do a global bitmap.

But imo this naming is not very convenient - it would be nicer if we

a) allowed users to specify a name (not sure how that would work
logistically)
b) made the namecnt variable for automatically named containers
be per-directory. I'd much rather see

/containers/node1/node1
/containers/node2
than
/containers/node1/node3
/containers/node2

(assuming /node2 was created between /node1 and /node1/node1 or
/node1/node3)

thanks,
-serge
 
Read Message
Read Message
Read Message
Previous Topic: [RFC][PATCH 0/16] Enable cloning of pid namespace
Next Topic: [PATCH 2.6.16] Fix NULL bio crash in loop worker thread
Goto Forum:
  


Current Time: Thu Jul 17 10:20:32 GMT 2025

Total time taken to generate the page: 0.04731 seconds