Bug 803851

Summary: SELinux denies NetworkManager access to sysctl.conf
Product: [Fedora] Fedora Reporter: Leonid Zhaldybin <lzhaldyb>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: brovvnout+rh, dwalsh, esammons, tim
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-04 13:52:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Leonid Zhaldybin 2012-03-15 18:43:28 UTC
Description of problem:
Disconnecting network cable and then plugging it back on causes the following "denied" messages in audit.log on my laptop:

type=AVC msg=audit(1331836352.088:721): avc:  denied  { read } for  pid=616 comm="NetworkManager" name="sysctl.conf" dev="sda5" ino=22404 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:system_conf_t:s0 tclass=file
type=AVC msg=audit(1331836352.088:722): avc:  denied  { open } for  pid=616 comm="NetworkManager" name="sysctl.conf" dev="sda5" ino=22404 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:system_conf_t:s0 tclass=file
type=AVC msg=audit(1331836352.088:723): avc:  denied  { getattr } for  pid=616 comm="NetworkManager" path="/etc/sysctl.conf" dev="sda5" ino=22404 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:system_conf_t:s0 tclass=file

Nevertheless, network connection seems to be working fine. This might be a bug in NetworkManager which tries to access config file which it shouldn't use.

Version-Release number of selected component (if applicable):
[root@localhost ~]# rpm -qa | grep selinux | sort
libselinux-2.1.9-9.fc17.x86_64
libselinux-python-2.1.9-9.fc17.x86_64
libselinux-utils-2.1.9-9.fc17.x86_64
selinux-policy-3.10.0-95.fc17.noarch
selinux-policy-targeted-3.10.0-95.fc17.noarch
[root@localhost ~]# rpm -qa | grep NetworkManager | sort
NetworkManager-0.9.3.995-0.4.git20120302.fc17.x86_64
NetworkManager-glib-0.9.3.995-0.4.git20120302.fc17.x86_64
NetworkManager-openvpn-0.9.3.995-1.git20120302.fc17.x86_64
NetworkManager-pptp-0.9.3.995-1.git20120302.fc17.x86_64
NetworkManager-vpnc-0.9.3.995-1.git20120302.fc17.x86_64

How reproducible:
always

Steps to Reproduce:
1. Disconnect network cable from NIC.
2. Plug it back in.
3.
  
Actual results:
SELinux denial messages in audit.log stating that NetworkManager tried to access config file /etc/sysctl.conf

Expected results:
No SELinux denial messages in system logs.

Additional info:

Comment 1 Leonid Zhaldybin 2012-03-15 18:49:07 UTC
The same messages appear when I'm trying to connect to a wifi network.

Comment 2 Miroslav Grepl 2012-03-16 08:13:23 UTC
It should be fixed in the latest policy.

$ yum update selinux-policy-targeted --enablerepo=updates-testing

Comment 3 Leonid Zhaldybin 2012-03-16 18:07:30 UTC
(In reply to comment #2)
> It should be fixed in the latest policy.
> 
> $ yum update selinux-policy-targeted --enablerepo=updates-testing

The latest version in the repositories seems to be 3.10.0-95, and the error is not fixed in it:

[root@localhost ~]# yum update --enablerepo=updates-testing
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Update Process
No Packages marked for Update
[root@localhost ~]# yum list selinux-policy-targeted --showduplicates
Loaded plugins: langpacks, presto, refresh-packagekit
Installed Packages
selinux-policy-targeted.noarch                                                      3.10.0-95.fc17                                                      @updates-testing
Available Packages
selinux-policy-targeted.noarch                                                      3.10.0-91.fc17                                                      fedora          
selinux-policy-targeted.noarch                                                      3.10.0-95.fc17                                                      updates-testing

Comment 4 Fedora End Of Life 2013-07-04 07:45:06 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.