Bug 725811

Summary: SELinux is preventing /usr/sbin/dnsmasq from 'write' accesses on the file dnsmasq.pid.
Product: [Fedora] Fedora Reporter: Stian Ellingsen <stiell>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:4e8adb6f2379885142b73357898b94255fc5103ed5578673bffdfec015a40a5a
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-27 07:13:16 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 Stian Ellingsen 2011-07-26 16:08:41 UTC
SELinux is preventing /usr/sbin/dnsmasq from 'write' accesses on the file dnsmasq.pid.

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

If you believe that dnsmasq should be allowed write access on the dnsmasq.pid 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                unconfined_u:object_r:var_run_t:s0
Target Objects                dnsmasq.pid [ file ]
Source                        dnsmasq
Source Path                   /usr/sbin/dnsmasq
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           dnsmasq-2.52-2.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-34.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.8-35.fc15.i686 #1 SMP Wed Jul 6
                              14:46:26 UTC 2011 i686 i686
Alert Count                   1
First Seen                    ti. 26. juli 2011 kl. 18.04 +0000
Last Seen                     ti. 26. juli 2011 kl. 18.04 +0000
Local ID                      62e53dad-be3a-473f-8958-7c6107aadb36

Raw Audit Messages
type=AVC msg=audit(1311696298.607:240): avc:  denied  { write } for  pid=10097 comm="dnsmasq" name="dnsmasq.pid" dev=tmpfs ino=782268 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1311696298.607:240): arch=i386 syscall=open success=no exit=EACCES a0=806999c a1=8241 a2=1b6 a3=0 items=0 ppid=1 pid=10097 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,var_run_t,file,write

audit2allow

#============= dnsmasq_t ==============
allow dnsmasq_t var_run_t:file write;

audit2allow -R

#============= dnsmasq_t ==============
allow dnsmasq_t var_run_t:file write;

Comment 1 Miroslav Grepl 2011-07-27 07:13:16 UTC
Have you ever started dnsmasq directly (without using a service script)?

Execute

# restorecon -R -v /var/run/dnsmasq.pid