Re: [PATCH v4 0/2] cgroup: allow management of subtrees by new cgroup namespaces

From: James Bottomley
Date: Fri May 20 2016 - 11:31:09 EST


On Fri, 2016-05-20 at 08:22 -0700, Tejun Heo wrote:
> On Sat, May 21, 2016 at 12:48:48AM +1000, Aleksa Sarai wrote:
> > Are there any comments on this version of the patchset? I thought
> > we had reached an agreement that the underlying feature (allowing a
> > process to manage its own cgroups) was useful. Is there a better
> > way of solving this problem, that I don't know of?
>
> I still don't see why this is necessary. Delegation is done through
> chmodding. There's no reason to deviate for namespaces.

Given it's merge window time, I haven't yet had time to look at the
patch, but I can tell you why it (or something like it) is necessary:
unprivileged containers need to be able to set up cgroups as well as
namespaces, so we do need a way for the user ns owner to modify cgroups
in their default configuration otherwise cgroups just won't fit into
the unprivileged model. Whether this should be through the cgroup ns
is up for debate, as is how we should actually allow this to happen and
what we should present to the user ns owner, but we do need a way to do
this.

Delegation can't be through chmodding in this case because the user ns
owner can't chmod something owned by init_user_ns root.

James