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 1343776 - "ip netns del" cannot unmount /run/netns/*
Summary: "ip netns del" cannot unmount /run/netns/*
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-07 22:55 UTC by Garrett Holmstrom
Modified: 2016-11-04 02:30 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.13.1-80.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 02:30:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2283 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2016-11-03 13:36:25 UTC

Description Garrett Holmstrom 2016-06-07 22:55:25 UTC
Description of problem:
While the ifconfig policy appears to have some support for ``ip netns add'' commands, it does not appear to have a working policy for ``ip netns del'' commands, resulting in the following audit messages:

type=EXECVE msg=audit(1465332391.813:10109): argc=4 a0="ip" a1="netns" a2="del" a3="test"
type=CWD msg=audit(1465332391.813:10109):  cwd="/"
type=PATH msg=audit(1465332391.813:10109): item=0 name="/usr/sbin/ip" inode=671234140 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00
 obj=system_u:object_r:ifconfig_exec_t:s0 objtype=NORMAL
type=PATH msg=audit(1465332391.813:10109): item=1 name="/lib64/ld-linux-x86-64.so.2" inode=134225977 dev=fd:00 mode=0100755 ouid=0 og
id=0 rdev=00:00 obj=system_u:object_r:ld_so_t:s0 objtype=NORMAL
type=AVC msg=audit(1465332391.814:10110): avc:  denied  { unmount } for  pid=13634 comm="ip" scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:proc_t:s0 tclass=filesystem
type=SYSCALL msg=audit(1465332391.814:10110): arch=c000003e syscall=166 success=yes exit=0 a0=7fff21238770 a1=2 a2=7fff2123878b a3=7fff212384e0 items=1 ppid=16607 pid=13634 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)
type=CWD msg=audit(1465332391.814:10110):  cwd="/"
type=PATH msg=audit(1465332391.814:10110): item=0 name="/var/run/netns/test" inode=4026532434 dev=00:03 mode=0100444 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:proc_t:s0 objtype=NORMAL


Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-60.el7_2.3.noarch


How reproducible:
When enforcing


Steps to Reproduce:
1. setenforce 0  # work around bug 1340572
2. ip netns add test
3. setenforce 1
4. ip netns del test


Actual results:
Cannot remove namespace file "/var/run/netns/test": Device or resource busy


Expected results:
(no output)

Comment 2 Milos Malik 2016-06-08 08:23:12 UTC
# sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
# runcon system_u:system_r:initrc_t:s0 bash -c '/usr/sbin/ip netns add test'
# runcon system_u:system_r:initrc_t:s0 bash -c '/usr/sbin/ip netns list'
test
# runcon system_u:system_r:initrc_t:s0 bash -c '/usr/sbin/ip netns del test'
Cannot remove namespace file "/var/run/netns/test": Device or resource busy
# 

Following SELinux denial appeared in permissive mode:
----
type=PATH msg=audit(06/08/2016 10:17:39.213:821) : item=0 name=/var/run/netns/test inode=4026532240 dev=00:03 mode=file,444 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:proc_t:s0 objtype=NORMAL 
type=CWD msg=audit(06/08/2016 10:17:39.213:821) :  cwd=/root 
type=SYSCALL msg=audit(06/08/2016 10:17:39.213:821) : arch=x86_64 syscall=umount2 success=yes exit=0 a0=0x7ffc728c7fe0 a1=MNT_DETACH a2=0x7ffc728c7ff3 a3=0x7ffc728c7d50 items=1 ppid=3240 pid=8134 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=1 comm=ip exe=/usr/sbin/ip subj=system_u:system_r:ifconfig_t:s0 key=(null) 
type=AVC msg=audit(06/08/2016 10:17:39.213:821) : avc:  denied  { unmount } for  pid=8134 comm=ip scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:proc_t:s0 tclass=filesystem 
----

Following SELinux denial appeared in enforcing mode:
----
type=PATH msg=audit(06/08/2016 10:19:01.462:862) : item=0 name=/var/run/netns/test inode=4026532240 dev=00:03 mode=file,444 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:proc_t:s0 objtype=NORMAL 
type=CWD msg=audit(06/08/2016 10:19:01.462:862) :  cwd=/root 
type=SYSCALL msg=audit(06/08/2016 10:19:01.462:862) : arch=x86_64 syscall=umount2 success=no exit=EACCES(Permission denied) a0=0x7ffcb98c68c0 a1=MNT_DETACH a2=0x7ffcb98c68d3 a3=0x7ffcb98c6630 items=1 ppid=3240 pid=8426 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=1 comm=ip exe=/usr/sbin/ip subj=system_u:system_r:ifconfig_t:s0 key=(null) 
type=AVC msg=audit(06/08/2016 10:19:01.462:862) : avc:  denied  { unmount } for  pid=8426 comm=ip scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:proc_t:s0 tclass=filesystem 
----

Comment 6 errata-xmlrpc 2016-11-04 02:30:52 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/RHBA-2016-2283.html


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