-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for cgroup namespaces #781
Conversation
This looks good. We'll wait for upstream PR to be merged. |
this is the key for the non root containers :) |
@jfrazelle Not really. This doesn't help with non root as we discussed on the dev list. This just namespaces the cgroups path inside the container. |
Ah boooooo, is the goal in linux to eventually make it have more power or On Tue, Apr 26, 2016 at 9:43 AM, Mrunal Patel [email protected]
Jessie Frazelle |
what a disappointing feature haha On Tue, Apr 26, 2016 at 9:47 AM, Jessica Frazelle [email protected] wrote:
Jessie Frazelle |
@jfrazelle Hopefully it will be more useful in the feature :) |
Yeah, tbh I was a bit dissapointed when someone mentioned the new feature to me and I looked it up -- there's so much more it could do. For example, it could fake [REMOVED OLD PATCH IDEA] [REMOVED OTHER PATCH IDEA] I've decided to make it so that You can see the current state of my kernel patch in my Linux branch. /cc @jfrazelle @mrunalp |
Yeah, it does make sense from security perspective that container can't change its own cgroups limits but allowing managing subtress is reasonable. Following the upstream converstion @cyphar. Thanks! |
This is a very simple implementation because it doesn't require any configuration unlike the other namespaces, and in its current state it only masks paths. This feature is available in Linux 4.6+ and is enabled by default for kernels compiled with CONFIG_CGROUP=y. Signed-off-by: Aleksa Sarai <[email protected]>
I am also working on adding support for cgroup namespace in runc recently. Now I'm confused that if there is necessity that we allow containers have shared cgroup ns. Since the intention of cgroup ns is to mask cgroup paths, it can somewhat prevent host's information exposed to container. For example, if we run a container without cgroup ns, then its
This exposure of cgroup names to the processes running inside a container may result in some problems. With cgroup ns enabled, container's
Then, if we run another container(in another session) which has shared cgroup ns with the above one, its
We can see that, part of cgroup paths is now exposed to processes running inside this container. Besides, I think paths like So I don't think it's necessary to allow containers have shared cgroup ns, it's not secure either. WDYT @cyphar |
@yummypeng If you set Also, note that it hasn't exposed the entire cgroup path (just the shared ancestor component), so it's not as big of a deal as you might think. Also as for this:
They're not accessible, but they tell you something about what cgroup you're in. Inside a cgroup namespace, all However, if you're playing around with cgroup namespaces note that you have to also rewrite some of the |
@cyphar Thanks for your suggestion. I would think it twice:wink: |
@cyphar Do you mind @yummypeng working with you on this PR and push her commits to your branch? |
@hqhq No problem. In fact if @yummypeng wants to carry this PR I'm totally fine with that (I've got way too much stuff on my plate recently 😸). |
Close in favor of #1184 . |
config-linux: RFC 2119 wording for oomScoreAdj
This is a very simple implementation because it doesn't require any
configuration unlike the other namespaces, and in its current state it
only masks paths.
This feature is available in Linux 4.6+ and is enabled by default if
the kernel is compiled with
CONFIG_CGROUP=y
.TODO:
rootfs_linux
setup to actually mountcgroup
if we're in a cgroup + user namespace.Depends on opencontainers/runtime-spec#397