Bug 546305 - SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to nm-system-settings.conf (etc_t).
Summary: SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to nm-syste...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-10 16:16 UTC by Jerry Amundson
Modified: 2010-01-19 19:34 UTC (History)
2 users (show)

Fixed In Version: 3.6.12-93.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-15 19:18:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jerry Amundson 2009-12-10 16:16:45 UTC
Description of problem:
SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to
nm-system-settings.conf (etc_t).

Version-Release number of selected component (if applicable):
selinux-policy-3.6.12-91.fc11

How reproducible:
once

Steps to Reproduce:
1.livecd-creator with fc11 desktop
2.livecd-iso-to-disk
3.boot, login to desktop, change nm settings.
  
Actual results:
avc

Expected results:
no avc

Additional info:

Summary:

SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to
nm-system-settings.conf (etc_t).

Detailed Description:

SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to
nm-system-settings.conf (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
(nm-system-settings.conf) 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 'nm-system-settings.conf'. 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
'nm-system-settings.conf'

Fix Command:

restorecon 'nm-system-settings.conf'

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                nm-system-settings.conf [ file ]
Source                        nm-system-setti
Source Path                   /usr/sbin/nm-system-settings
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           NetworkManager-0.7.2-1.fc11
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.12-91.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   mislabeled_file
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 2.6.30.9-102.fc11.i586
                              #1 SMP Thu Dec 3 23:46:37 EST 2009 i686 i686
Alert Count                   1
First Seen                    Thu 10 Dec 2009 04:07:11 PM EST
Last Seen                     Thu 10 Dec 2009 04:07:11 PM EST
Local ID                      c5ebff01-3874-4284-a531-18783e97e95d
Line Numbers                  

Raw Audit Messages            

node=localhost.localdomain type=AVC msg=audit(1260479231.228:38688): avc:  denied  { unlink } for  pid=2236 comm="nm-system-setti" name="nm-system-settings.conf" dev=dm-0 ino=35797 scontext=system_u:system_r:NetworkManager_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file

node=localhost.localdomain type=SYSCALL msg=audit(1260479231.228:38688): arch=40000003 syscall=38 success=no exit=-13 a0=93a0cb8 a1=9396528 a2=5431a4 a3=b78406e0 items=0 ppid=1 pid=2236 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 Daniel Walsh 2009-12-10 16:32:31 UTC
Miroslav, you need /var/lib/NetworkManager labeled ASAP.

Comment 2 Miroslav Grepl 2009-12-11 08:43:46 UTC
The labeling for /var/lib/NetworkManager directory was added to selinux-policy-3.6.12-92.fc11. Should be available from updates-testing now.

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

Comment 3 Jerry Amundson 2009-12-28 22:19:26 UTC
Changing NM settings now results in this avc, and the suggested restorecon does nothing....

Summary:

SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to
/etc/NetworkManager/nm-system-settings.conf (etc_t).

Detailed Description:

SELinux is preventing nm-system-setti (NetworkManager_t) "unlink" to
/etc/NetworkManager/nm-system-settings.conf (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 (/etc/NetworkManager/nm-system-settings.conf) 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
'/etc/NetworkManager/nm-system-settings.conf'. 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
'/etc/NetworkManager/nm-system-settings.conf'

Fix Command:

restorecon '/etc/NetworkManager/nm-system-settings.conf'

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                /etc/NetworkManager/nm-system-settings.conf [ file
                              ]
Source                        nm-system-setti
Source Path                   /usr/sbin/nm-system-settings
Port                          <Unknown>
Host                          jerry-opti755
Source RPM Packages           NetworkManager-0.7.2-1.fc11
Target RPM Packages           NetworkManager-0.7.2-1.fc11
Policy RPM                    selinux-policy-3.6.12-92.fc11
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   mislabeled_file
Host Name                     jerry-opti755
Platform                      Linux jerry-opti755 2.6.30.10-105.fc11.x86_64 #1
                              SMP Thu Dec 24 16:41:51 UTC 2009 x86_64 x86_64
Alert Count                   2
First Seen                    Mon 07 Dec 2009 02:47:01 PM CST
Last Seen                     Mon 28 Dec 2009 02:56:03 PM CST
Local ID                      f00c90aa-4012-43f7-b4b6-01fd5b56dfdc
Line Numbers                  

Raw Audit Messages            

node=jerry-opti755 type=AVC msg=audit(1262033763.947:29161): avc:  denied  { unlink } for  pid=1609 comm="nm-system-setti" name="nm-system-settings.conf" dev=dm-1 ino=106852 scontext=system_u:system_r:NetworkManager_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=file

node=jerry-opti755 type=SYSCALL msg=audit(1262033763.947:29161): arch=c000003e syscall=82 success=no exit=-13 a0=202c9e0 a1=201b250 a2=206a860 a3=1 items=0 ppid=1 pid=1609 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 4 Daniel Walsh 2009-12-29 21:59:54 UTC
Does this package have the label

/etc/NetworkManager(/.*)?	system_u:object_r:NetworkManager_var_lib_t:s0

Comment 5 Jerry Amundson 2009-12-31 16:13:17 UTC
(In reply to comment #4)
> Does this package have the label
> /etc/NetworkManager(/.*)? system_u:object_r:NetworkManager_var_lib_t:s0  

Is that directed toward anyone in general, or just Miroslav?

Comment 6 Daniel Walsh 2010-01-04 14:08:02 UTC
Miroslav can answer it.

Jerry,

What does matchpathcon /etc/NetworkManager 

Return?

Comment 7 Miroslav Grepl 2010-01-04 14:28:39 UTC
Ok, my mistake. I have added only labeling for /var/lib/NetworkManager directory. Jerry thanks for check.

Comment 8 Miroslav Grepl 2010-01-06 10:16:28 UTC
Fixed in selinux-policy-3.6.12-93.fc11

Comment 9 Fedora Update System 2010-01-08 14:30:31 UTC
selinux-policy-3.6.12-93.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.12-93.fc11

Comment 10 Fedora Update System 2010-01-12 23:41:06 UTC
selinux-policy-3.6.12-93.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2010-0446

Comment 11 Fedora Update System 2010-01-19 19:34:05 UTC
selinux-policy-3.6.12-93.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.


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