Skip to content
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

Make GID optional to allow retaining overflowgid (useful for exposing crw-rw---- devices to Rootless Containers) #1129

Open
AkihiroSuda opened this issue Nov 16, 2021 · 2 comments

Comments

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Nov 16, 2021

https://github.com/opencontainers/runtime-spec/blob/v1.0.2/config.md

In the current spec, .process.user.gid is defined as a REQUIRED attribute.

I suggest makng this attribute OPTIONAL to allow retaining overflowgid, by avoiding calling setgroups(2).
When gid is unset, additionalGids MUST be unset, too.

This is useful for exposing crw-rw---- devices to Rootless Containers:

I have issues mounting a device with rootless docker through --device /dev/ttyUSB0. The device is accessible outside the docker to users of the dialout group. But I suspect the group is not properly propagated to the docker container. The device shows up as

crw-rw---- 1 nobody nogroup 188, 0 Nov 15 15:59 /dev/ttyUSB0

within the docker. On the host it is

crw-rw---- 1 root dialout 188, 0 Nov 15 07:59 /dev/ttyUSB0

Trying to access the device leads to a Permission denied error.

@AkihiroSuda
Copy link
Member Author

@cyphar @giuseppe @kolyshkin WDYT?

@giuseppe
Copy link
Member

I agree it is useful. crun implements it with an annotation. I have already opened a similar issue: #1020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants