mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: fix hang when using Unshareflags: CLONE_NEWUSER with uid/gid 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>
This commit is contained in:
parent
178a2c4225
commit
958e212db7
1 changed files with 1 additions and 1 deletions
|
|
@ -154,7 +154,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
|
||||||
runtime_BeforeFork()
|
runtime_BeforeFork()
|
||||||
locked = true
|
locked = true
|
||||||
switch {
|
switch {
|
||||||
case runtime.GOARCH == "amd64" && sys.Cloneflags&CLONE_NEWUSER == 0:
|
case runtime.GOARCH == "amd64" && (sys.Cloneflags&CLONE_NEWUSER == 0 && sys.Unshareflags&CLONE_NEWUSER == 0):
|
||||||
r1, err1 = rawVforkSyscall(SYS_CLONE, uintptr(SIGCHLD|CLONE_VFORK|CLONE_VM)|sys.Cloneflags)
|
r1, err1 = rawVforkSyscall(SYS_CLONE, uintptr(SIGCHLD|CLONE_VFORK|CLONE_VM)|sys.Cloneflags)
|
||||||
case runtime.GOARCH == "s390x":
|
case runtime.GOARCH == "s390x":
|
||||||
r1, _, err1 = RawSyscall6(SYS_CLONE, 0, uintptr(SIGCHLD)|sys.Cloneflags, 0, 0, 0, 0)
|
r1, _, err1 = RawSyscall6(SYS_CLONE, 0, uintptr(SIGCHLD)|sys.Cloneflags, 0, 0, 0, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue