RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1405306 - docker run with parameter "--privileged" get failed
Summary: docker run with parameter "--privileged" get failed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.3
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
: 1405476 1406319 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-16 07:23 UTC by Wenkai Shi
Modified: 2019-03-06 00:47 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 20:44:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:0116 0 normal SHIPPED_LIVE Moderate: docker security, bug fix, and enhancement update 2017-01-18 01:39:43 UTC

Description Wenkai Shi 2016-12-16 07:23:46 UTC
Description of problem:
Install latest docker and try docker run with parameter "--privileged", it failed. Can succeed without parameter "--privileged".

Version-Release number of selected component (if applicable):
docker-common-1.12.4-3.el7.x86_64
docker-rhel-push-plugin-1.12.4-3.el7.x86_64
docker-client-1.12.4-3.el7.x86_64
docker-1.12.4-3.el7.x86_64
container-selinux-1.12.4-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Install docker
[root@host ~]# yum install docker -y
2.Start docker.service
[root@host ~]# systemctl start docker
3.Do docker run
[root@host ~]# docker run -it --rm --privileged centos /bin/bash
...

Actual results:
Command failed

[root@host ~]# docker run -it --rm --privileged centos /bin/bash
Unable to find image 'centos:latest' locally
Trying to pull repository registry.access.redhat.com/centos ... 
Trying to pull repository docker.io/library/centos ... 
sha256:c577af3197aacedf79c5a204cd7f493c8e07ffbce7f88f7600bf19c688c38799: Pulling from docker.io/library/centos
45a2e645736c: Pull complete 
Digest: sha256:c577af3197aacedf79c5a204cd7f493c8e07ffbce7f88f7600bf19c688c38799
Status: Downloaded newer image for docker.io/centos:latest
panic: standard_init_linux.go:175: exec user process caused "permission denied" [recovered]
    panic: standard_init_linux.go:175: exec user process caused "permission denied"

goroutine 1 [running, locked to thread]:
panic(0x6f2ea0, 0xc42014ae00)
    /usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/urfave/cli.HandleAction.func1(0xc420091748)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x247
panic(0x6f2ea0, 0xc42014ae00)
    /usr/lib/golang/src/runtime/panic.go:458 +0x243
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc420091198, 0xc42001e018, 0xc420091238)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x18f
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc42004e230, 0xaac9c0, 0xc42014ae00)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x353
main.glob..func8(0xc420094a00, 0x0, 0x0)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/main_unix.go:26 +0x66
reflect.Value.call(0x6ddc20, 0x769b48, 0x13, 0x73c049, 0x4, 0xc420091708, 0x1, 0x1, 0x4d1728, 0x731ea0, ...)
    /usr/lib/golang/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0x6ddc20, 0x769b48, 0x13, 0xc420091708, 0x1, 0x1, 0xac2700, 0xc4200916e8, 0x4da706)
    /usr/lib/golang/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0x6ddc20, 0x769b48, 0xc420094a00, 0x0, 0x0)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x1e0
github.com/urfave/cli.Command.Run(0x73c215, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74d852, 0x51, 0x0, ...)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xc3b
github.com/urfave/cli.(*App).Run(0xc4200b6000, 0xc420064060, 0x2, 0x2, 0x0, 0x0)
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x611
main.main()
    /builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/main.go:137 +0xbd6

[root@host ~]# ausearch -m avc -ts recent
----
time->Fri Dec 16 02:16:17 2016
type=SYSCALL msg=audit(1481872577.148:10086): arch=c000003e syscall=59 success=no exit=-13 a0=c42014c1a0 a1=c4201186c0 a2=c4200dd450 a3=0 items=0 ppid=23848 pid=23863 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="exe" exe="/usr/libexec/docker/docker-runc-current" subj=system_u:system_r:container_runtime_t:s0 key=(null)
type=AVC msg=audit(1481872577.148:10086): avc:  denied  { entrypoint } for  pid=23863 comm="exe" path="/usr/bin/openshift" dev="dm-4" ino=8488478 scontext=system_u:system_r:spc_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file
----
time->Fri Dec 16 02:16:32 2016
type=SYSCALL msg=audit(1481872592.385:10109): arch=c000003e syscall=59 success=no exit=-13 a0=c42014c1a0 a1=c42011a6c0 a2=c4200dd450 a3=0 items=0 ppid=23955 pid=23970 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="exe" exe="/usr/libexec/docker/docker-runc-current" subj=system_u:system_r:container_runtime_t:s0 key=(null)
type=AVC msg=audit(1481872592.385:10109): avc:  denied  { entrypoint } for  pid=23970 comm="exe" path="/usr/bin/openshift" dev="dm-4" ino=8488478 scontext=system_u:system_r:spc_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file
----
time->Fri Dec 16 02:18:04 2016
type=SYSCALL msg=audit(1481872684.212:10190): arch=c000003e syscall=59 success=no exit=-13 a0=c4200e14a0 a1=c4200e14b0 a2=c42011a510 a3=0 items=0 ppid=24080 pid=24094 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4294967295 comm="exe" exe="/usr/libexec/docker/docker-runc-current" subj=system_u:system_r:container_runtime_t:s0 key=(null)
type=AVC msg=audit(1481872684.212:10190): avc:  denied  { entrypoint } for  pid=24094 comm="exe" path="/usr/bin/bash" dev="dm-4" ino=16798231 scontext=system_u:system_r:spc_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file


[root@host ~]# ps -eZ | grep docker
system_u:system_r:container_runtime_t:s0 12281 ? 00:00:45 dockerd-current
system_u:system_r:container_runtime_t:s0 12285 ? 00:00:01 docker-containe

Expected results:
Command succeed

Additional info:
If upgrade docker from 1.10 to 1.12, no such issue, only a fresh install could reproduce this issue.

Comment 2 Johnny Liu 2016-12-16 08:50:38 UTC
I do not think they are the same issue. Note that:
Run docker run with parameter "--privileged", it failed. Can succeed without parameter "--privileged".

Comment 3 Alex Jia 2016-12-16 09:08:28 UTC
(In reply to Johnny Liu from comment #2)
> I do not think they are the same issue. Note that:
> Run docker run with parameter "--privileged", it failed. Can succeed without
> parameter "--privileged".

The policy is disabled and it works well if you change SELinux to Permissive status, or enable docker policy.

[root@atomic-00 cloud-user]# semodule -lfull | grep docker
100 docker            pp disabled

Comment 5 Daniel Walsh 2016-12-16 13:30:51 UTC
I have updated container-selinux to handle this issue.

cc14935f9a5ee1977b853dc85b3dd4ba3a16d320 fixes this issue in the RHEL-1.12 branch.

Comment 6 Daniel Walsh 2016-12-16 13:35:55 UTC
This looks like we should have the fix in container-selinux-1.12.4-3.el7.x86_64

Could you attempt a reinstall of container-selinux

# dnf reinstall container-selinux

If that succeeds could you tell me if this outputs anything?

# sesearch -T -s container_runtime_t -c process -t unlabeled_t

Comment 7 Wenkai Shi 2016-12-16 15:54:21 UTC
(In reply to Daniel Walsh from comment #6)
> This looks like we should have the fix in
> container-selinux-1.12.4-3.el7.x86_64
> 
> Could you attempt a reinstall of container-selinux
> 
> # dnf reinstall container-selinux
> 
> If that succeeds could you tell me if this outputs anything?
> 
> # sesearch -T -s container_runtime_t -c process -t unlabeled_t

[root@host ~]# yum info container-selinux
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Installed Packages
Name        : container-selinux
Arch        : x86_64
Epoch       : 2
Version     : 1.12.4
Release     : 3.el7
Size        : 29 k
Repo        : installed
From repo   : rhel73-extra
Summary     : SELinux policies for container runtimes
URL         : https://github.com/docker/docker
License     : ASL 2.0
Description : SELinux policy modules for use with container runtimes.


[root@host ~]# yum reinstall container-selinux -y
...
Complete!

[root@host ~]# sesearch -T -s container_runtime_t -c process -t unlabeled_t
Found 1 semantic te rules:
   type_transition container_runtime_t unlabeled_t : process spc_t;

And it still reproduce:

[root@qe-weshi-cute-me ~]# docker run -it --rm --privileged centos /bin/bash
panic: standard_init_linux.go:175: exec user process caused "permission denied" [recovered]
	panic: standard_init_linux.go:175: exec user process caused "permission denied"

goroutine 1 [running, locked to thread]:
panic(0x6f2ea0, 0xc420148e00)
	/usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/urfave/cli.HandleAction.func1(0xc42007f748)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x247
panic(0x6f2ea0, 0xc420148e00)
	/usr/lib/golang/src/runtime/panic.go:458 +0x243
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc42007f198, 0xc42001e090, 0xc42007f238)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x18f
github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc42004f450, 0xaac9c0, 0xc420148e00)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x353
main.glob..func8(0xc420082a00, 0x0, 0x0)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/main_unix.go:26 +0x66
reflect.Value.call(0x6ddc20, 0x769b48, 0x13, 0x73c049, 0x4, 0xc42007f708, 0x1, 0x1, 0x4d1728, 0x731ea0, ...)
	/usr/lib/golang/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0x6ddc20, 0x769b48, 0x13, 0xc42007f708, 0x1, 0x1, 0xac2700, 0xc42007f6e8, 0x4da706)
	/usr/lib/golang/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0x6ddc20, 0x769b48, 0xc420082a00, 0x0, 0x0)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x1e0
github.com/urfave/cli.Command.Run(0x73c215, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74d852, 0x51, 0x0, ...)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xc3b
github.com/urfave/cli.(*App).Run(0xc4200b0000, 0xc42000c120, 0x2, 0x2, 0x0, 0x0)
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x611
main.main()
	/builddir/build/BUILD/docker-1b5971af3003488d3fd8add80de5125ee1e096ee/runc-b8dbc3b8e8d868723aec2fd5082e6547ec66cf58/main.go:137 +0xbd6

Comment 8 Mike Fiedler 2016-12-16 15:58:13 UTC
All OCP s2i builds are failing due to this (3.4.0.37).

Comment 9 Mike Fiedler 2016-12-16 15:58:42 UTC
*** Bug 1405476 has been marked as a duplicate of this bug. ***

Comment 12 Mike Fiedler 2016-12-20 15:52:24 UTC
I cannot reproduce this on docker-1.12.5-4.el7.  s2i builds in OCP run successfully

Comment 13 Scott Dodson 2016-12-21 14:19:16 UTC
*** Bug 1406319 has been marked as a duplicate of this bug. ***

Comment 15 Luwen Su 2017-01-10 03:21:59 UTC
In docker-1.12.5-9.el7.x86_64

# docker run -it --rm --privileged centos /bin/bash
Unable to find image 'centos:latest' locally
Trying to pull repository registry.access.redhat.com/centos ... 
Trying to pull repository docker.io/library/centos ... 
latest: Pulling from docker.io/library/centos
45a2e645736c: Pull complete 
Digest: sha256:c577af3197aacedf79c5a204cd7f493c8e07ffbce7f88f7600bf19c688c38799
[root@e76e9c812dff /]# 

Move to verified.

Comment 17 errata-xmlrpc 2017-01-17 20:44:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2017-0116.html


Note You need to log in before you can comment on or make changes to this bug.