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

syscall: namespace tests fail on Linux with RHEL7.2 ppc64le #13312

Closed
laboger opened this issue Nov 18, 2015 · 17 comments
Closed

syscall: namespace tests fail on Linux with RHEL7.2 ppc64le #13312

laboger opened this issue Nov 18, 2015 · 17 comments
Milestone

Comments

@laboger
Copy link
Contributor

@laboger laboger commented Nov 18, 2015

When building gccgo or gc on RHEL7 2 and running the testsuite, the testcase exec_linux_test.go fails for both gccgo and gc. This happens with gccgo built from trunk and with golang from master with this output from go version:

go version devel +6bf794a Wed Nov 18 19:00:45 2015 +0000 linux/ppc64le

With golang, there are 3 error messages:

go test .
--- FAIL: TestCloneNEWUSERAndRemapNoRootDisableSetgroups (0.00s)
exec_linux_test.go:57: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestCloneNEWUSERAndRemapNoRootSetgroupsEnableSetgroups (0.00s)
exec_linux_test.go:97: Unprivileged gid_map rewriting with GidMappingsEnableSetgroups must fail
--- FAIL: TestEmptyCredGroupsDisableSetgroups (0.00s)
exec_linux_test.go:105: fork/exec /usr/bin/whoami: invalid argument
FAIL
FAIL syscall 0.014s

And with gccgo there are 2:
make syscall/check
--- FAIL: TestCloneNEWUSERAndRemapNoRootDisableSetgroups (0.00s)
testing.go:284: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestCloneNEWUSERAndRemapNoRootSetgroupsEnableSetgroups (0.00s)
testing.go:284: Unprivileged gid_map rewriting with GidMappingsEnableSetgroups must fail
FAIL

I know there was another issue for this test related to whoami but the error message was not the same.

I don't see these failures when I build gccgo or golang on other platforms (Ubuntu 14.04, 14.10, SLES12SP1) with the same level of source for the compilers.

uname -r output:

3.10.0-313.el7.ppc64le

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 18, 2015

CC @LK4D4

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Nov 18, 2015
@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 18, 2015

@laboger Could you check CONFIG_USER_NS in your kernel config, pls?
EDIT: You obviously have it, because other tests passing.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 18, 2015

I suppose it might be because of SeLinux rules. Could you try to disable it and rerun? Thanks!

@laboger
Copy link
Contributor Author

@laboger laboger commented Nov 19, 2015

CONFIG_USER_NS=y
I tried:
setenforce 0
getenforce
Permissive

tests still failed as before.

I set SELINUX to disabled and rebooted.
getenforce
Disabled

tests still failed as before.

I also tried a fedora21 ppc64le system and that passes with selinux enabled. Only RHEL 7.2 fails.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 19, 2015

@laboger Can you try to run tests from root? I'll try to setup VM with rhel 7.2 myself to look at problem.
ping @mrunalp

@laboger
Copy link
Contributor Author

@laboger laboger commented Nov 19, 2015

Same failures when run as root.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 19, 2015

@laboger Are you sure that tests names not different? Those tests should be skipped with root.

@laboger
Copy link
Contributor Author

@laboger laboger commented Nov 19, 2015

Oops sorry I wasn't expecting the failing testnames to be different and didn't look closely.

Here's my screen output:
[root@willow2 syscall]# pwd
/home/boger/golang/gitsrc/latest/go/src/syscall
[root@willow2 syscall]# go test .
--- FAIL: TestCloneNEWUSERAndRemapRootDisableSetgroups (0.00s)
exec_linux_test.go:57: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestCloneNEWUSERAndRemapRootEnableSetgroups (0.00s)
exec_linux_test.go:57: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestEmptyCredGroupsDisableSetgroups (0.00s)
exec_linux_test.go:105: fork/exec /usr/bin/whoami: invalid argument
FAIL
FAIL syscall 0.018s
[root@willow2 syscall]# pwd
/home/boger/golang/gitsrc/latest/go/src/syscall
[root@willow2 libgo]# which go
/home/boger/golang/gitsrc/latest/go/bin/go

And with gccgo, I have to hit Ctrl-C to get the output if I run as root:

root@willow2 libgo]# make syscall/check
^C--- FAIL: TestCloneNEWUSERAndRemapRootDisableSetgroups (0.00s)
testing.go:284: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
--- FAIL: TestCloneNEWUSERAndRemapRootEnableSetgroups (0.00s)
testing.go:284: Cmd failed with err fork/exec /usr/bin/whoami: invalid argument, output:
/home/boger/gccgo.work/trunk/bld/../src/libgo/testsuite/gotest: line 625: kill: (7658) - No such process

@mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 19, 2015

The unshare system call is returning EINVAL.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 19, 2015

So, it's bug in RHEL, which must be fixed. I'm glad that we helped with finding it :)

@mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 19, 2015

mount namespace isn't supported with user namespace in RHEL 7.2 as some patches haven't been backported. So, this is expected behavior for now.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Nov 19, 2015

@mrunalp I don't see mount namespaces in tests. Maybe without mount namespaces?

@mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 19, 2015

@LK4D4 Let me try that. I tried with everything in my testing.

@mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 19, 2015

@LK4D4 You are right. That fails as well. I am following up with RHEL engineers.

@mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 19, 2015

One has to enable user namespace support with a kernel boot option as it is in tech preview right now. After adding user_namespace.enable=1 as a boot option unshare -Ur works for me.

@rsc rsc changed the title syscall: exec_linux_test.go failures on ppc64le RHEL7.2 with gccgo and gc syscall: namespace tests fail on Linux with RHEL7.2 ppc64le Nov 24, 2015
@rsc
Copy link
Contributor

@rsc rsc commented Nov 24, 2015

From @mrunalp's comments it sounds like this is not a Go bug.

@rsc rsc closed this Nov 24, 2015
@rsc
Copy link
Contributor

@rsc rsc commented Nov 24, 2015

(We could of course disable the test, if this is important to any developers on RHEL 7.2 and we can detect that case.)

@golang golang locked and limited conversation to collaborators Nov 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.