Bug 546052

Summary: SELinux is preventing NetworkManager (NetworkManager_t) "write" to /var/lib (var_lib_t).
Product: [Fedora] Fedora Reporter: Jeremy Huddleston <jeremyhu>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: ceechef1, copperjoy2002, dwalsh, hvdkooij, jackal_road2000, liana, ljtyson, mgrepl, nowin93, spider, wlee
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:180bf30dcd76d65b92f2c3b96975f8d409b3267cacecf6aaadd5e662a79ee534
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-09 21:55:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeremy Huddleston 2009-12-09 21:38:25 UTC
Summary:

SELinux is preventing NetworkManager (NetworkManager_t) "write" to /var/lib
(var_lib_t).

Detailed Description:

SELinux is preventing NetworkManager (NetworkManager_t) "write" to /var/lib
(var_lib_t). The SELinux type var_lib_t, is a generic type for all files in the
directory and very few processes (SELinux Domains) are allowed to write to this
SELinux type. This type of denial usual indicates a mislabeled file. By default
a file created in a directory has the gets the context of the parent directory,
but SELinux policy has rules about the creation of directories, that say if a
process running in one SELinux Domain (D1) creates a file in a directory with a
particular SELinux File Context (F1) the file gets a different File Context
(F2). The policy usually allows the SELinux Domain (D1) the ability to write,
unlink, and append on (F2). But if for some reason a file (/var/lib) was created
with the wrong context, this domain will be denied. The usual solution to this
problem is to reset the file context on the target file, restorecon -v
'/var/lib'. If the file context does not change from var_lib_t, then this is
probably a bug in policy. Please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against the selinux-policy
package. If it does change, you can try your application again to see if it
works. The file context could have been mislabeled by editing the file or moving
the file from a different directory, if the file keeps getting mislabeled, check
the init scripts to see if they are doing something to mislabel the file.

Allowing Access:

You can attempt to fix file context by executing restorecon -v '/var/lib'

Fix Command:

restorecon '/var/lib'

Additional Information:

Source Context                system_u:system_r:NetworkManager_t:s0
Target Context                system_u:object_r:var_lib_t:s0
Target Objects                /var/lib [ dir ]
Source                        NetworkManager
Source Path                   /usr/sbin/NetworkManager
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           NetworkManager-0.7.2-1.fc11
Target RPM Packages           filesystem-2.4.21-1.fc11
Policy RPM                    selinux-policy-3.6.12-91.fc11
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   mislabeled_file
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.30.9-102.fc11.x86_64 #1 SMP Fri Dec 4 00:18:53
                              EST 2009 x86_64 x86_64
Alert Count                   1
First Seen                    Tue 08 Dec 2009 03:54:51 PM PST
Last Seen                     Tue 08 Dec 2009 03:54:51 PM PST
Local ID                      c46cdd39-16a2-43b7-82a2-640f88f1ba6d
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1260316491.301:5): avc:  denied  { write } for  pid=1536 comm="NetworkManager" name="lib" dev=dm-0 ino=114693 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=dir

node=(removed) type=SYSCALL msg=audit(1260316491.301:5): arch=c000003e syscall=83 success=no exit=-13 a0=227dd80 a1=1ed a2=72 a3=7fffb48a8600 items=0 ppid=1535 pid=1536 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="NetworkManager" exe="/usr/sbin/NetworkManager" subj=system_u:system_r:NetworkManager_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.12-91.fc11,mislabeled_file,NetworkManager,NetworkManager_t,var_lib_t,dir,write
audit2allow suggests:

#============= NetworkManager_t ==============
allow NetworkManager_t var_lib_t:dir write;

Comment 1 Daniel Walsh 2009-12-09 21:55:22 UTC

*** This bug has been marked as a duplicate of bug 538428 ***