-
Notifications
You must be signed in to change notification settings - Fork 594
IsHostUnprivileged flag for host #228
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
IsHostUnprivileged flag for host #228
Conversation
This flag indicates that the host that is launching the container is unprivileged. Setting this to true ensures that implementations will be able avoid erroring on actions that unprivileged hosts cannot perform(such as mknod). Signed-off-by: Abin Shahab <ashahab@altiscale.com>
|
On Wed, Oct 21, 2015 at 04:03:16PM -0700, Abin Shahab wrote:
“Unprivileged” isn't very clear. It looks like Stepping back, my personal preference would be to not have default |
|
@wking If I launched a container with a non-root user from host mapped as the root in the container, and then try launching a container from inside the container, this child container launch is going to fail even if the CAP_MKNOD is enabled, as this is an inability of the "host"(which is an unprivileged container). |
|
On Wed, Oct 21, 2015 at 05:19:25PM -0700, Abin Shahab wrote:
Oh, I see. I that case (and if we have keep the mknod calls enabled And again, I think this whole thing is much easier with the “op-into |
|
Makes sense for me. However maybe we can find better naming. |
|
@wking I agree with your assessment. Thanks for the links. |
|
On Wed, Oct 21, 2015 at 09:14:30PM -0700, Abin Shahab wrote:
Is that just because of the uid:gid ownership of the cgroup files?
Or (3) adjust the spec to make this sort of activity op-in, or (4) |
|
I don't think i'm that big of a fan of this change. Let me think about it more but I think we can handle these type of things internally in a runtime. |
|
Sure, I would prefer handling it internally if we can read some state that On Thu, Oct 22, 2015 at 10:25 AM, Michael Crosby notifications@github.com
|
|
Is this because you want to support nested user namespaces? |
|
@crosbymichael Yes, that is our usecase: opencontainers/runc#350 |
|
I dont think bring this right now into the specs is a good idea. In fact the approach might be flawed. Without cgroup namespacing, i think the only possible way to do it cleanly right now is to communicate to an external privileged process that can manage cgroups for us ( like systemd if possible or cgmanager ). |
|
On Thu, Oct 22, 2015 at 02:45:12PM -0700, Daniel, Dao Quang Minh wrote:
Can someone point me at more details on the trouble with cgroups? It |
|
@wking Yes this is a specific issue with the devices cgroup. Probably because of this: "In case one of the locally set whitelist entries would provide more access than the cgroup's parent, it'll be removed from the whitelist." |
|
On Thu, Oct 22, 2015 at 03:03:46PM -0700, Abin Shahab wrote:
Hmm, that looks like it's propagating down into children, which seems
+1 to separating cgroups handling from the spec. It seems like it Or is the proposal just to split off device cgroups? Or is it just to |
|
@wking Yes. I am with you on your first proposal. I'm not suggesting splitting off devices, nor do I really want special treatment for unprivileged users(despite my PR). |
|
I think that we should research some ways for the runtime to determine whether it is in a user namespace |
|
@mrunalp yes that is my same feeling. This can be handled at the runtime level and I believe that we had this before that if you got an EPERM on mknod then we did the bind mount for adding devices. |
|
@crosbymichael Yeah, that's the hack that I had in mind ;) |
|
@mrunalp i know you too well ;) |
|
@mrunalp @crosbymichael So I can push a PR in runc where mknod and writing devices cgroup ignores EPERM errors. Is that what you guys have in mind? Then we don't need this PR. |
|
Thanks for the pr in runc, I think we can close this one now. |
This flag indicates that the host that is launching the container is
unprivileged. Setting this to true ensures that implementations will be
able avoid erroring on actions that unprivileged hosts cannot
perform(such as mknod).
An example of this is in runc: opencontainers/runc#351
Signed-off-by: Abin Shahab ashahab@altiscale.com