-
Notifications
You must be signed in to change notification settings - Fork 18k
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
syscall: Unshareflags CLONE_NEWUSER (unprivileged user namespaces) does not work with uid/gid mappings (Linux) #29789
Comments
Do you mean Go 1.11 or Go 1.12beta2? If this isn't a regression from Go 1.11, then this is Go 1.13 material. |
Change https://golang.org/cl/158297 mentions this issue: |
Change https://golang.org/cl/158298 mentions this issue: |
This issue is reproducible with Go 1.11.4, Go 1.12beta2 and tip. |
… mapping (linux) Note that this particular combination of properties still fails (EPERM), but it no longer hangs. Updates #29789 Change-Id: I29b15b85a25a7acd7ae89ffc5fed074bcdfe0a12 Reviewed-on: https://go-review.googlesource.com/c/go/+/158297 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
… mapping (linux) Note that this particular combination of properties still fails (EPERM), but it no longer hangs. Updates golang#29789 Change-Id: I29b15b85a25a7acd7ae89ffc5fed074bcdfe0a12 Reviewed-on: https://go-review.googlesource.com/c/go/+/158297 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Before this CL, uid/gid mapping was always set up from the parent process, which is a privileged operation. When using unprivileged user namespaces, a process can modify its uid/gid mapping after the unshare(2) call (but setting the uid/gid mapping from another process is NOT possible). Fixes golang#29789 Change-Id: I8c96a03f5da23fe80bbb83ef051ad89cf185d750 Reviewed-on: https://go-review.googlesource.com/c/go/+/158298 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/CiH9UtCuYzQ demonstrates what I’m trying to do in two ways: once with
unshare(1)
, which is working, and once purely in Go, where the process hangs (!):(Relevant code snippet pasted for discoverability of this issue.)
Even after fixing the hang, the uid/gid mapping fails with EPERM, because Go tries to apply them from the parent process, but they need to be applied in the child, after
unshare(2)
.I’ve sent https://go-review.googlesource.com/c/go/+/158297/1 and https://go-review.googlesource.com/c/go/+/158298 to fix this.
The text was updated successfully, but these errors were encountered: