Bug 1271924

Summary: SELinux is preventing /usr/sbin/dnsmasq from 'getattr' accesses on the file /etc/resolv.conf.
Product: [Fedora] Fedora Reporter: Gil Forcada <gforcada>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b4b9b8deaf9d181a4754f4af59964bcf0e5239ef9b7b05ed6e2adc7c514ffb51;VARIANT_ID=workstation;
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-16 14:48:40 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 Gil Forcada 2015-10-15 06:25:28 UTC
Description of problem:
SELinux is preventing /usr/sbin/dnsmasq from 'getattr' accesses on the file /etc/resolv.conf.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that dnsmasq should be allowed getattr access on the resolv.conf 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 dnsmasq /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:dnsmasq_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:home_bin_t:s0
Target Objects                /etc/resolv.conf [ file ]
Source                        dnsmasq
Source Path                   /usr/sbin/dnsmasq
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           dnsmasq-2.72-3.fc22.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-128.13.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.1.7-200.fc22.x86_64 #1 SMP Mon
                              Sep 14 20:19:24 UTC 2015 x86_64 x86_64
Alert Count                   89
First Seen                    2015-10-14 22:23:25 EEST
Last Seen                     2015-10-15 09:23:36 EEST
Local ID                      3b59cb48-7fc7-4a59-9299-02a405566955

Raw Audit Messages
type=AVC msg=audit(1444890216.193:717): avc:  denied  { getattr } for  pid=1765 comm="dnsmasq" path="/etc/resolv.conf" dev="sdb1" ino=1048833 scontext=system_u:system_r:dnsmasq_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:home_bin_t:s0 tclass=file permissive=0


type=SYSCALL msg=audit(1444890216.193:717): arch=x86_64 syscall=stat success=no exit=EACCES a0=55d3e63d4bac a1=7ffd6dc6e560 a2=7ffd6dc6e560 a3=7ffd6dc6e7d0 items=0 ppid=1 pid=1765 auid=4294967295 uid=99 gid=40 euid=99 suid=99 fsuid=99 egid=40 sgid=40 fsgid=40 tty=(none) ses=4294967295 comm=dnsmasq exe=/usr/sbin/dnsmasq subj=system_u:system_r:dnsmasq_t:s0-s0:c0.c1023 key=(null)

Hash: dnsmasq,dnsmasq_t,home_bin_t,file,getattr

Version-Release number of selected component:
selinux-policy-3.13.1-128.13.fc22.noarch

Additional info:
reporter:       libreport-2.6.2
hashmarkername: setroubleshoot
kernel:         4.1.7-200.fc22.x86_64
type:           libreport

Comment 1 Daniel Walsh 2015-10-16 14:48:40 UTC
Looks like your /etc/resolv.conf file is labeled home_bin_t?  

restorecon -v /etc/resolv.conf

Should fix the problem. Did you mv this file from somewhere in your homedir?

Comment 2 Daniel Walsh 2015-10-16 14:49:01 UTC
*** Bug 1271930 has been marked as a duplicate of this bug. ***

Comment 3 Daniel Walsh 2015-10-16 14:49:24 UTC
*** Bug 1271933 has been marked as a duplicate of this bug. ***

Comment 4 Daniel Walsh 2015-10-16 14:49:35 UTC
*** Bug 1271935 has been marked as a duplicate of this bug. ***

Comment 5 Daniel Walsh 2015-10-16 14:51:25 UTC
*** Bug 1272014 has been marked as a duplicate of this bug. ***

Comment 6 Daniel Walsh 2015-10-16 14:51:40 UTC
*** Bug 1272015 has been marked as a duplicate of this bug. ***

Comment 7 Gil Forcada 2015-10-16 15:37:27 UTC
Thanks Daniel to take a look at it!

As for moving the file, no, as far as I remember I did not move that file.