Bug 682462

Summary: SELinux is preventing /usr/sbin/dnsmasq from 'getattr' accesses on the file /var/run/nm-dns-dnsmasq.conf.
Product: [Fedora] Fedora Reporter: Amit Shah <amit.shah>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:bf01c11cbdb2852af5092fde1cf42422bcf07fc4db10917aacfef21e30a88927
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-07 10:37: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:

Description Amit Shah 2011-03-05 18:22:41 UTC
SELinux is preventing /usr/sbin/dnsmasq from 'getattr' accesses on the file /var/run/nm-dns-dnsmasq.conf.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/var/run/nm-dns-dnsmasq.conf default label should be var_run_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/run/nm-dns-dnsmasq.conf

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that dnsmasq should be allowed getattr access on the nm-dns-dnsmasq.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
Target Context                system_u:object_r:NetworkManager_var_run_t:s0
Target Objects                /var/run/nm-dns-dnsmasq.conf [ file ]
Source                        dnsmasq
Source Path                   /usr/sbin/dnsmasq
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           dnsmasq-2.52-1.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-31.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38-0.rc6.git6.1.fc15.x86_64 #1 SMP Sat Feb 26
                              01:14:56 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Sat 05 Mar 2011 11:37:28 PM IST
Last Seen                     Sat 05 Mar 2011 11:37:28 PM IST
Local ID                      fdab930b-27c9-40cb-b406-f14703bdb91f

Raw Audit Messages
type=AVC msg=audit(1299348448.710:24833): avc:  denied  { getattr } for  pid=2190 comm="dnsmasq" path="/var/run/nm-dns-dnsmasq.conf" dev=dm-3 ino=8520132 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1299348448.710:24833): arch=x86_64 syscall=stat success=no exit=EACCES a0=720b00 a1=7fff91bc2180 a2=7fff91bc2180 a3=fffffffffffffff0 items=0 ppid=1190 pid=2190 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=dnsmasq exe=/usr/sbin/dnsmasq subj=system_u:system_r:dnsmasq_t:s0 key=(null)

Hash: dnsmasq,dnsmasq_t,NetworkManager_var_run_t,file,getattr

audit2allow

#============= dnsmasq_t ==============
allow dnsmasq_t NetworkManager_var_run_t:file getattr;

audit2allow -R

#============= dnsmasq_t ==============
allow dnsmasq_t NetworkManager_var_run_t:file getattr;

Comment 1 Miroslav Grepl 2011-03-07 10:37:22 UTC

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