Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Docker can not mount /etc/mtab from host due to selinux denial.
/etc/mtab is a symlink to /proc/self/mounts
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
# docker run --rm --privileged -v /etc/mtab:/etc/node-mtab rhel7 echo "hello"
container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"/etc/mtab\\\" to rootfs \\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs\\\" at \\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs/etc/node-mtab\\\" caused \\\"permission denied\\\"\""
/usr/bin/docker-current: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:54: mounting \\\\\\\"/etc/mtab\\\\\\\" to rootfs \\\\\\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs\\\\\\\" at \\\\\\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs/etc/node-mtab\\\\\\\" caused \\\\\\\"permission denied\\\\\\\"\\\"\"\n".
# ausearch -m avc --start recent | audit2why
type=AVC msg=audit(1495820838.586:378): avc: denied { mounton } for pid=3659 comm="exe" path="/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs/etc/node-mtab" dev="proc" ino=46861 scontext=system_u:system_r:container_runtime_t:s0 tcontext=system_u:system_r:container_runtime_t:s0 tclass=file
Was caused by:
Missing type enforcement (TE) allow rule.
You can use audit2allow to generate a loadable module to allow this access.
# ausearch -m avc --start recent | audit2allow
#============= container_runtime_t ==============
allow container_runtime_t self:file mounton;
Description of problem: Docker can not mount /etc/mtab from host due to selinux denial. /etc/mtab is a symlink to /proc/self/mounts Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: # docker run --rm --privileged -v /etc/mtab:/etc/node-mtab rhel7 echo "hello" container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"/etc/mtab\\\" to rootfs \\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs\\\" at \\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs/etc/node-mtab\\\" caused \\\"permission denied\\\"\"" /usr/bin/docker-current: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:54: mounting \\\\\\\"/etc/mtab\\\\\\\" to rootfs \\\\\\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs\\\\\\\" at \\\\\\\"/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs/etc/node-mtab\\\\\\\" caused \\\\\\\"permission denied\\\\\\\"\\\"\"\n". # ausearch -m avc --start recent | audit2why type=AVC msg=audit(1495820838.586:378): avc: denied { mounton } for pid=3659 comm="exe" path="/var/lib/docker/devicemapper/mnt/853c9ecd325aa048e77336fa31e3352773da519e6bbd6e6d99b4890241dd0687/rootfs/etc/node-mtab" dev="proc" ino=46861 scontext=system_u:system_r:container_runtime_t:s0 tcontext=system_u:system_r:container_runtime_t:s0 tclass=file Was caused by: Missing type enforcement (TE) allow rule. You can use audit2allow to generate a loadable module to allow this access. # ausearch -m avc --start recent | audit2allow #============= container_runtime_t ============== allow container_runtime_t self:file mounton;