Bug 500020 - selinux prevent work nm
selinux prevent work nm
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-10 04:27 EDT by Alexey Kuznetsov
Modified: 2009-05-11 08:10 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-11 08:10:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alexey Kuznetsov 2009-05-10 04:27:09 EDT
Summary:

SELinux is preventing nm-system-setti (NetworkManager_t) "write" to ifcfg-eth0
(etc_t).

Detailed Description:

[SELinux is in permissive mode, the operation would have been denied but was
permitted due to permissive mode.]

SELinux is preventing nm-system-setti (NetworkManager_t) "write" to ifcfg-eth0
(etc_t). The SELinux type etc_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 (ifcfg-eth0) 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
'ifcfg-eth0'. If the file context does not change from etc_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 'ifcfg-eth0'

Fix Command:

restorecon 'ifcfg-eth0'

Additional Information:

Source Context                system_u:system_r:NetworkManager_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_t:s0
Target Objects                ifcfg-eth0 [ file ]
Source                        nm-system-setti
Source Path                   /usr/sbin/nm-system-settings
Port                          <Unknown>
Host                          axet-laptop.local
Source RPM Packages           NetworkManager-0.7.1-4.git20090414.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-28.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Permissive
Plugin Name                   mislabeled_file
Host Name                     axet-laptop.local
Platform                      Linux axet-laptop.local 2.6.29.2-126.fc11.i686.PAE
                              #1 SMP Mon May 4 04:48:39 EDT 2009 i686 i686
Alert Count                   2
First Seen                    Sun 10 May 2009 12:24:39 PM MSD
Last Seen                     Sun 10 May 2009 12:25:15 PM MSD
Local ID                      59913173-c561-47dd-ab43-f030d8bdc600
Line Numbers                  

Raw Audit Messages            

node=axet-laptop.local type=AVC msg=audit(1241943915.180:28631): avc:  denied  { write } for  pid=1767 comm="nm-system-setti" name="ifcfg-eth0" dev=sda1 ino=8617998 scontext=system_u:system_r:NetworkManager_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file

node=axet-laptop.local type=SYSCALL msg=audit(1241943915.180:28631): arch=40000003 syscall=5 success=yes exit=10 a0=9528208 a1=41 a2=1a4 a3=953b188 items=0 ppid=1 pid=1767 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="nm-system-setti" exe="/usr/sbin/nm-system-settings" subj=system_u:system_r:NetworkManager_t:s0-s0:c0.c1023 key=(null)
Comment 1 Miroslav Grepl 2009-05-11 04:08:19 EDT
Execute:

restorecon -R -v /etc/sysconfig

Should fix.
Comment 2 Alexey Kuznetsov 2009-05-11 05:39:13 EDT
yep. done.
Comment 3 Daniel Walsh 2009-05-11 08:10:44 EDT
If you update to selinux-policy-3.6.12-33.fc11.noarch  All of the labeling should be correct.

There is a bug in system-config-network interacting with SELinux that is causing this problem.  Please update to all the latest packages.

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