Bug 1124517

Summary: SELinux is preventing /usr/sbin/NetworkManager from 'unlink' accesses on the file .
Product: [Fedora] Fedora Reporter: sheepdestroyer <sheepdestroyer>
Component: geditAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dominick.grift, dwalsh, lvrabec, manday, mgrepl, pedro.galvao, rstrode, sheepdestroyer
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:77261c568d4cfcbf07123b7b7e390e3dff8311e7b19383353fadd043dc635488
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-29 21:49:57 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 sheepdestroyer 2014-07-29 16:50:29 UTC
Description of problem:
SELinux is preventing /usr/sbin/NetworkManager from 'unlink' accesses on the file .

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow NetworkManager to have unlink access on the  file
Then you need to change the label on $FIX_TARGET_PATH
Do
# semanage fcontext -a -t FILE_TYPE '$FIX_TARGET_PATH'
where FILE_TYPE is one of the following: NetworkManager_etc_rw_t, NetworkManager_tmp_t, NetworkManager_var_lib_t, NetworkManager_var_run_t, dhcpc_state_t, dhcpc_var_run_t, dnsmasq_var_run_t, hostname_etc_t, named_cache_t, net_conf_t, pppd_var_run_t, systemd_passwd_var_run_t. 
Then execute: 
restorecon -v '$FIX_TARGET_PATH'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that NetworkManager should be allowed unlink access on the  file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep NetworkManager /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:NetworkManager_t:s0
Target Context                unconfined_u:object_r:etc_t:s0
Target Objects                 [ file ]
Source                        NetworkManager
Source Path                   /usr/sbin/NetworkManager
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           NetworkManager-0.9.9.1-4.git20140319.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-179.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.15.6-200.fc20.x86_64 #1 SMP Fri
                              Jul 18 02:36:27 UTC 2014 x86_64 x86_64
Alert Count                   2
First Seen                    2014-07-30 01:47:40 JST
Last Seen                     2014-07-30 01:47:44 JST
Local ID                      532aadba-9612-4e2b-9204-3e6620fe7f2d

Raw Audit Messages
type=AVC msg=audit(1406652464.297:744): avc:  denied  { unlink } for  pid=646 comm="NetworkManager" name="resolv.conf" dev="sda6" ino=2883912 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file


type=SYSCALL msg=audit(1406652464.297:744): arch=x86_64 syscall=rename success=no exit=EACCES a0=7fea0f1dde70 a1=7fea0f1d8c50 a2=1 a3=26 items=0 ppid=1 pid=646 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: NetworkManager,NetworkManager_t,etc_t,file,unlink

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.15.6-200.fc20.x86_64
type:           libreport

Potential duplicate: bug 666454

Comment 1 Daniel Walsh 2014-08-06 21:57:07 UTC
Looks like /etc/resolv.conf got mislabeled.

restorecon /etc/resolv.conf

Should fix.

Any idea how this happened?

Comment 2 sheepdestroyer 2014-08-07 16:34:10 UTC
I guess it's because I edited the file to setup dnsmask

Comment 3 Daniel Walsh 2014-08-07 20:42:40 UTC
What editor did you use?

Comment 4 sheepdestroyer 2014-08-07 22:56:45 UTC
I did : sudo gedit /etc/resolv.conf

Comment 5 Daniel Walsh 2014-08-18 13:06:04 UTC
gedit should maintain the security attributes/Xattrs of all files that it edits and replaces.

Comment 6 Cedric Sodhi 2014-12-12 12:49:05 UTC
Description of problem:
Alert shows up on every boot, Network-Manager allegedly trying to unlink file ''

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.17.4-200.fc20.x86_64
type:           libreport

Comment 7 Daniel Walsh 2015-01-02 16:54:01 UTC
Did you run restorecon /etc/resolv.conf on it?

Comment 8 Cedric Sodhi 2015-01-02 17:02:35 UTC
If this was for me: No.

Comment 9 Daniel Walsh 2015-01-03 13:07:48 UTC
Well run it and see if it solves your problem.

 ls -Z /etc/resolv.conf 
system_u:object_r:net_conf_t:s0 /etc/resolv.conf

Comment 10 Fedora End Of Life 2015-05-29 12:30:25 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 EOL if it remains open with a Fedora  'version'
of '20'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 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 this bug is closed as described in the policy above.

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.

Comment 11 Fedora End Of Life 2015-06-29 21:49:57 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.