Bug 705243

Summary: SELinux is preventing /usr/sbin/avahi-daemon from read, write access on the file /var/run/avahi-daemon//pid.
Product: [Fedora] Fedora Reporter: Thomas Meyer <thomas.mey>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:0cea6cae77ee8da1018fce1734b4f0c46f60e889af7e3d0f4032309cf703b238
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-17 12:41:14 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 Thomas Meyer 2011-05-17 06:16:36 UTC
SELinux is preventing /usr/sbin/avahi-daemon from read, write access on the file /var/run/avahi-daemon//pid.

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

If you want to fix the label. 
/var/run/avahi-daemon//pid default label should be avahi_var_run_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /var/run/avahi-daemon//pid

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

If you believe that avahi-daemon should be allowed read write access on the 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 avahi-daemon /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:avahi_t:s0
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                /var/run/avahi-daemon//pid [ file ]
Source                        avahi-daemon
Source Path                   /usr/sbin/avahi-daemon
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           avahi-0.6.30-3.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-23.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.5-24.fc15.i686
                              #1 SMP Fri May 6 08:02:58 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Di 17 Mai 2011 08:13:48 CEST
Last Seen                     Di 17 Mai 2011 08:13:48 CEST
Local ID                      8cbac71c-7fd2-440c-a0bd-460cae1b38c1

Raw Audit Messages
type=AVC msg=audit(1305612828.348:192): avc:  denied  { read write } for  pid=7928 comm="avahi-daemon" name="pid" dev=tmpfs ino=79018 scontext=system_u:system_r:avahi_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1305612828.348:192): arch=i386 syscall=open success=no exit=EACCES a0=805cacc a1=8002 a2=0 a3=2 items=1 ppid=1 pid=7928 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=avahi-daemon exe=/usr/sbin/avahi-daemon subj=system_u:system_r:avahi_t:s0 key=(null)

type=CWD msg=audit(1305612828.348:192): cwd=/

type=PATH msg=audit(1305612828.348:192): item=0 name=/var/run/avahi-daemon//pid inode=79018 dev=00:12 mode=0100644 ouid=498 ogid=493 rdev=00:00 obj=unconfined_u:object_r:var_run_t:s0

Hash: avahi-daemon,avahi_t,var_run_t,file,read,write

audit2allow

#============= avahi_t ==============
allow avahi_t var_run_t:file { read write };

audit2allow -R

#============= avahi_t ==============
allow avahi_t var_run_t:file { read write };

Comment 1 Miroslav Grepl 2011-05-17 12:41:14 UTC
# ls -dZ /var/run/avahi-daemon/

# matchpathcon /var/run/avahi-daemon/



The pid file is mislabeled. You will need to run

# restorecon -R -v /var/run/avahi-daemon/