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:
As part of adding an interface to a running container, we execute the following command:
ip netns exec $pid ip link set dev mgmt-in name mgmt
When that command is executed, SELinux kicks in and the following entries are see in audit.log
type=AVC msg=audit(1450281422.633:9548): avc: denied { mounton } for pid=56100 comm="ip" path="/" dev="dm-1" ino=128 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir
type=SYSCALL msg=audit(1450281422.633:9548): arch=x86_64 syscall=mount success=yes exit=0 a0=43c4d4 a1=4372cf a2=43838d a3=84000 items=0 ppid=56063 pid=56100 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ip exe=/usr/sbin/ip subj=system_u:system_r:ifconfig_t:s0 key=(null)
Version-Release number of selected component (if applicable):
# rpm -qa | grep selinux
selinux-policy-targeted-3.13.1-23.el7.noarch
docker-selinux-1.8.2-7.el7.x86_64
selinux-policy-3.13.1-23.el7.noarch
How reproducible:
Every time
Steps to Reproduce:
1. Launch a container with net=none
2. Add interface
pid=$(docker inspect -f '{{.State.Pid}}' `docker ps -a | grep my_container | awk '{print $1}'`)
ip link add mgmt-out type veth peer name mgmt-in
ip link set mgmt-out up
ip link set mgmt-in netns $pid
ip netns exec $pid ip link set dev mgmt-in name mgmt
Actual results:
type=AVC msg=audit(1450281422.633:9548): avc: denied { mounton } for pid=56100 comm="ip" path="/" dev="dm-1" ino=128 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir
type=SYSCALL msg=audit(1450281422.633:9548): arch=x86_64 syscall=mount success=yes exit=0 a0=43c4d4 a1=4372cf a2=43838d a3=84000 items=0 ppid=56063 pid=56100 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ip exe=/usr/sbin/ip subj=system_u:system_r:ifconfig_t:s0 key=(null)
Expected results:
NO SELinux violations
Additional info:
Just for t-shooting, I also upgraded to rhel7.2 packaging, but still see the violation:
# rpm -qa | grep selinux
libselinux-python-2.2.2-6.el7.x86_64
libselinux-2.2.2-6.el7.x86_64
libselinux-utils-2.2.2-6.el7.x86_64
selinux-policy-3.13.1-60.el7.noarch
docker-selinux-1.8.2-10.el7.x86_64
selinux-policy-targeted-3.13.1-60.el7.noarch
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/RHBA-2016-2283.html
Description of problem: As part of adding an interface to a running container, we execute the following command: ip netns exec $pid ip link set dev mgmt-in name mgmt When that command is executed, SELinux kicks in and the following entries are see in audit.log type=AVC msg=audit(1450281422.633:9548): avc: denied { mounton } for pid=56100 comm="ip" path="/" dev="dm-1" ino=128 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir type=SYSCALL msg=audit(1450281422.633:9548): arch=x86_64 syscall=mount success=yes exit=0 a0=43c4d4 a1=4372cf a2=43838d a3=84000 items=0 ppid=56063 pid=56100 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ip exe=/usr/sbin/ip subj=system_u:system_r:ifconfig_t:s0 key=(null) Version-Release number of selected component (if applicable): # rpm -qa | grep selinux selinux-policy-targeted-3.13.1-23.el7.noarch docker-selinux-1.8.2-7.el7.x86_64 selinux-policy-3.13.1-23.el7.noarch How reproducible: Every time Steps to Reproduce: 1. Launch a container with net=none 2. Add interface pid=$(docker inspect -f '{{.State.Pid}}' `docker ps -a | grep my_container | awk '{print $1}'`) ip link add mgmt-out type veth peer name mgmt-in ip link set mgmt-out up ip link set mgmt-in netns $pid ip netns exec $pid ip link set dev mgmt-in name mgmt Actual results: type=AVC msg=audit(1450281422.633:9548): avc: denied { mounton } for pid=56100 comm="ip" path="/" dev="dm-1" ino=128 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:root_t:s0 tclass=dir type=SYSCALL msg=audit(1450281422.633:9548): arch=x86_64 syscall=mount success=yes exit=0 a0=43c4d4 a1=4372cf a2=43838d a3=84000 items=0 ppid=56063 pid=56100 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ip exe=/usr/sbin/ip subj=system_u:system_r:ifconfig_t:s0 key=(null) Expected results: NO SELinux violations Additional info: