From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Aleksa Sarai <asarai-l3A5Bk7waGM@public.gmane.org>,
Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Aleksa Sarai <cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dev-IGmTWi+3HBZvNhPySn5qfx2eb7JE58TQ@public.gmane.org
Subject: Re: [PATCH v4 0/2] cgroup: allow management of subtrees by new cgroup namespaces
Date: Fri, 20 May 2016 13:28:46 -0400 [thread overview]
Message-ID: <1463765326.8091.42.camel@HansenPartnership.com> (raw)
In-Reply-To: <20160520165326.GE5632-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
On Fri, 2016-05-20 at 12:53 -0400, Tejun Heo wrote:
> Hello,
>
> On Fri, May 20, 2016 at 12:25:09PM -0400, James Bottomley wrote:
> > OK, so is the only problem cleanup? If so, what if I proposed that
> > a
>
> For generic cases, it's a much larger problem. We'd have to change
> delegation model completely so that delegations are allowed by
> default, which btw can't be allowed on v1 hierarchies as some
> controllers don't behave properly hierarchically in v1 and would
> allow unpriv users to escape the constraints of its ancestors.
Just so I'm clear: by delegation you mean create a subdirectory in the
cgroup hierarchy with a non-root owner? We may have a solution for the
escape constraints problem: see below.
> > cgroup directory could only be created by the owner of the userns
> > (which would be any old unprivileged user) iff they create a cgroup
> > ns and the cgroup ns would be responsible for removing it again, so
> > the cgroup subdirectory would be tied to the cgroup namespace as
> > its holder and we'd use release of the cgroup to remove all the
> > directories?
>
> Unfortunately, cgroup hierarchy isn't designed to support this sort
> of automatic delegation. Unpriv processes would be able to escape
> constraints on v1 with some controllers and on v2 controllers have to
> be explicitly enabled by root for delegated scope to have access to
> them.
Not necessarily. We also talked about pinning the cgroup tree so that
once you enter the cgroup namespace, your current cgroup directory
becomes your root, meaning you can't cd back into the ancestors and
thus can't write their tasks file, meaning, I think, that it should be
impossible to escape ancestor constraints.
> We can try to isolate these delegated subtrees and make them
> work transparently, which rgroup tried to do, but that collides
> directly with the vfs conventions (rgroups don't show up in cgroup
> hierarchy at all so avoid this problem).
Well, let's see if we can solve it within the current framework first.
>
> Why does an unpriv NS need to have cgroup delegated to it without
> cooperation from cgroup manager?
There's actually many answers to this. The one I'm insterested in is
the ability for applications to make use of container features without
having to ask permission from some orchestration engine. The problem
most people are looking at is how do I prevent the cgroup manager from
running as root, because that's a security problem waiting to happen.
> If for resource control, I'm pretty sure we don't want to allow
> that without explicit cooperation from the enclosing scope.
The enclosing scope should be allowed to define the parameters (happens
today with namespaces) but there shouldn't be an active "thing" which
is the permission gateway.
> Overall, it feels like this is trying to work around an issue which
> should be solved from userland.
So it's not impossible to have some setuid (or CAP_ scoped) universal
binary do this. We do this today for the user namespace range of uids
problem. However, it would have to be something that operated
independently of the cgroup manager, since every container
orchestration system wants to be their own cgroup manager, so there's
no one true one.
James
next prev parent reply other threads:[~2016-05-20 17:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-14 3:19 [PATCH v4 0/2] cgroup: allow management of subtrees by new cgroup namespaces Aleksa Sarai
2016-05-14 3:19 ` [PATCH v4 1/2] cgroup: make cgroup.procs permissions userns-aware Aleksa Sarai
[not found] ` <1463196000-13900-1-git-send-email-asarai-l3A5Bk7waGM@public.gmane.org>
2016-05-14 3:20 ` [PATCH v4 2/2] cgroup: implement subtree creation on copy_cgroup_ns() Aleksa Sarai
2016-05-20 14:48 ` [PATCH v4 0/2] cgroup: allow management of subtrees by new cgroup namespaces Aleksa Sarai
[not found] ` <573F23D0.2030500-l3A5Bk7waGM@public.gmane.org>
2016-05-20 15:22 ` Tejun Heo
[not found] ` <20160520152244.GB5632-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2016-05-20 15:30 ` James Bottomley
[not found] ` <1463758258.8091.3.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2016-05-20 16:03 ` Tejun Heo
2016-05-20 16:09 ` James Bottomley
2016-05-20 16:17 ` Tejun Heo
[not found] ` <20160520161759.GD5632-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2016-05-20 16:25 ` James Bottomley
[not found] ` <1463761509.8091.19.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2016-05-20 16:29 ` Aleksa Sarai
2016-05-20 16:53 ` Tejun Heo
[not found] ` <20160520165326.GE5632-piEFEHQLUPpN0TnZuCh8vA@public.gmane.org>
2016-05-20 17:28 ` James Bottomley [this message]
[not found] ` <1463765326.8091.42.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2016-05-20 17:49 ` Tejun Heo
2016-05-28 5:12 ` Aleksa Sarai
2016-05-31 18:18 ` Tejun Heo
2016-05-20 17:33 ` W. Trevor King
2016-05-20 17:33 ` Aditya Kali
2016-05-20 17:50 ` James Bottomley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1463765326.8091.42.camel@HansenPartnership.com \
--to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
--cc=asarai-l3A5Bk7waGM@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=cyphar-gVpy/LI/lHzQT0dZR+AlfA@public.gmane.org \
--cc=dev-IGmTWi+3HBZvNhPySn5qfx2eb7JE58TQ@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).