Skip to content

os: TestRootChown fails in a user namespace with unmapped supplementary groups #77383

Description

@ophestra

Go version

go version go1.25.6 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='clang -O3 -Werror'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/tmp/gocache'
GOCACHEPROG=''
GODEBUG=''
GOENV=''
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2891874976=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE=''
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH=''
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/system/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='off'
GOTELEMETRYDIR=''
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/system/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.6'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Ran ./all.bash of go1.25.6 in a user namespace as a user with unmapped supplementary groups.

What did you see happen?

mbf: (go1.25.6:1) --- FAIL: TestRootChown (0.01s)
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/plain_path (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("target", -1, 65534) = chownat target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/path_in_directory (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("a/b/c/target", -1, 65534) = chownat a/b/c/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("link", -1, 65534) = chownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/symlink_ending_in_slash (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("link/target", -1, 65534) = chownat link/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/symlink_chain (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("link", -1, 65534) = chownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/path_with_dot (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("./a/./b/./target", -1, 65534) = chownat ./a/./b/./target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/path_with_dotdot (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("a/../a/b/../../a/b/../b/target", -1, 65534) = chownat a/../a/b/../../a/b/../b/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/dotdot_no_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("a/../target", -1, 65534) = chownat a/../target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/dotdot_after_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("a/../target", -1, 65534) = chownat a/../target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/dotdot_before_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("b/../a/target", -1, 65534) = chownat b/../a/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootChown/symlink_ends_in_dot (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:45: root.Chown("a/target", -1, 65534) = chownat a/target: invalid argument; want success
mbf: (go1.25.6:1) --- FAIL: TestRootLchown (0.01s)
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/plain_path (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("target", -1, 65534) = lchownat target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/path_in_directory (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("a/b/c/target", -1, 65534) = lchownat a/b/c/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link", -1, 65534) = lchownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_dotdot_slash (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link", -1, 65534) = lchownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_ending_in_slash (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link/target", -1, 65534) = lchownat link/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_dotdot_dotdot_slash (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("dir/link", -1, 65534) = lchownat dir/link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_chain (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link", -1, 65534) = lchownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/path_with_dot (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("./a/./b/./target", -1, 65534) = lchownat ./a/./b/./target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/path_with_dotdot (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("a/../a/b/../../a/b/../b/target", -1, 65534) = lchownat a/../a/b/../../a/b/../b/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/dotdot_no_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("a/../target", -1, 65534) = lchownat a/../target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/dotdot_after_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("a/../target", -1, 65534) = lchownat a/../target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/dotdot_before_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("b/../a/target", -1, 65534) = lchownat b/../a/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_ends_in_dot (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("a/target", -1, 65534) = lchownat a/target: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_cycle (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("a", -1, 65534) = lchownat a: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/absolute_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link", -1, 65534) = lchownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/relative_symlink (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link", -1, 65534) = lchownat link: invalid argument; want success
mbf: (go1.25.6:1)     --- FAIL: TestRootLchown/symlink_chain_escapes (0.00s)
mbf: (go1.25.6:1)         root_unix_test.go:85: root.Lchown("link", -1, 65534) = lchownat link: invalid argument; want success
mbf: (go1.25.6:1) FAIL
mbf: (go1.25.6:1) FAIL  os      1.058s

What did you expect to see?

All tests pass or skip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions