-
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
consider unifying mountEntry.srcFD and mountEntry.idmapFD approach #3935
Comments
I suspect that the best solution would actually be to entirely remove the idmapping logic from C and instead implement it in Go (if we can use While it's not perfect, given that the mountfd stuff is really quite niche, I would be in favour of requiring the new mount API for it to be used (this would limit the feature to Linux 5.2 and newer -- @alban is this a deal-breaker?) -- but it would mean we could completely eliminate the mountfd code from the C code in runc and it would completely unify the implementations (you would open all the bind-mount sources on the host with Unfortunately we cannot use |
@cyphar for idmap mounts forcing a minimum of 5.2 is not an issue, as we need newer kernels for idmap mounts anyways. For opening the mount sources, I think it might be fine too. I'm changing the k8s userns implementation to idmap mounts (we hit several limitations and concerns from other SIGs when we tried to avoid it), and opening the mount sources is also a patch we added for userns support in k8s, because /var/lib/kubelet/pods has permissions for root:root and nothing for others. I think this bug with what @thaJeztah reported is closed now that #3939 is merged (that part is unified). But do you want to open another issue with this idea of avoiding the C parts? |
Originally posted by @thaJeztah in #3717 (comment)
One uses a string with the path (
/proc/self/fd/<FD>
), whereas the other uses the bare FD (int
).We could consider using an
int
for both, and updatemountViaFDs()
(which is not exported) to internalize constructing the path if the value is not-1
;runc/libcontainer/mount_linux.go
Lines 67 to 71 in 05669c8
The text was updated successfully, but these errors were encountered: