Bug 875454

Summary: SELinux is preventing /usr/sbin/dnsmasq from read access on the directory /tftpboot
Product: [Fedora] Fedora Reporter: Vladislav Grigoryev <vg.aetera>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: aquini, dominick.grift, dwalsh, itamar, laine, mgrepl, thozza, veillard, vg.aetera
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 15:49:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladislav Grigoryev 2012-11-11 11:29:19 UTC
Description of problem:
SELinux is preventing /usr/sbin/dnsmasq from read access on the directory /tftpboot.

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

If you believe that dnsmasq should be allowed read access on the tftpboot directory 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:tftpdir_t:s0
Target Objects                /tftpboot [ dir ]
Source                        dnsmasq
Source Path                   /usr/sbin/dnsmasq
Port                          <Unknown>
Host                          srv06.kola.fad.ru
Source RPM Packages           dnsmasq-2.63-1.fc17.x86_64
Target RPM Packages           syslinux-tftpboot-4.05-1.fc17.x86_64
Policy RPM                    selinux-policy-3.10.0-156.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     srv06.kola.fad.ru
Platform                      Linux srv06.kola.fad.ru 3.6.5-1.fc17.x86_64 #1 SMP
                              Wed Oct 31 19:37:18 UTC 2012 x86_64 x86_64
Alert Count                   8
First Seen                    2012-11-10 22:55:00 MSK
Last Seen                     2012-11-11 15:17:38 MSK
Local ID                      6f7ea76e-a009-43b6-a69f-6b08e47ab48e

Raw Audit Messages
type=AVC msg=audit(1352632658.911:812): avc:  denied  { read } for  pid=17494 comm="dnsmasq" name="tftpboot" dev="dm-1" ino=3145729 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:tftpdir_t:s0 tclass=dir


type=SYSCALL msg=audit(1352632658.911:812): arch=x86_64 syscall=openat success=no exit=EACCES a0=ffffffffffffff9c a1=e99d20 a2=90800 a3=0 items=0 ppid=1 pid=17494 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 key=(null)

Hash: dnsmasq,dnsmasq_t,tftpdir_t,dir,read

audit2allow

#============= dnsmasq_t ==============
allow dnsmasq_t tftpdir_t:dir read;

audit2allow -R

#============= dnsmasq_t ==============
allow dnsmasq_t tftpdir_t:dir read;

Version-Release number of selected component (if applicable):
dnsmasq-2.63-1.fc17.x86_64
syslinux-tftpboot-4.05-1.fc17.x86_64
selinux-policy-3.10.0-156.fc17.noarch

How reproducible:
Always reproducible.

Actual results:
dnsmasq[17492]: TFTP directory /tftpboot inaccessible: Permission denied
dnsmasq[17492]: FAILED to start up

Expected results:
Can start dnsmasq as tftp-server.

Comment 1 Vladislav Grigoryev 2012-11-11 11:31:10 UTC
# ls -ldZ /tftpboot
drwxr-xr-x. nobody nobody system_u:object_r:tftpdir_t:s0   /tftpboot

Comment 2 Miroslav Grepl 2012-11-12 13:51:24 UTC
Fixed in selinux-policy-3.10.0-160.fc17

Comment 3 Fedora Update System 2012-11-21 11:53:56 UTC
selinux-policy-3.10.0-161.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-161.fc17

Comment 4 Fedora Update System 2012-11-22 03:56:05 UTC
Package selinux-policy-3.10.0-161.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-161.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-18787/selinux-policy-3.10.0-161.fc17
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2012-12-20 15:49:54 UTC
selinux-policy-3.10.0-161.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.