Bug 484199 - SELinux issue causing libvirtd launched dnsmasq to fail
SELinux issue causing libvirtd launched dnsmasq to fail
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
: 484292 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-05 07:08 EST by Mark McLoughlin
Modified: 2009-11-18 06:23 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 496867 (view as bug list)
Environment:
Last Closed: 2009-11-18 06:23:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark McLoughlin 2009-02-05 07:08:24 EST
This is rawhide with:

  libvirt-0.6.0-1.fc11.x86_64
  selinux-policy-3.6.3-12.fc11.noarch

default network isn't running after boot, trying to manually start it:

# virsh net-start default
libvir: error : internal error '/usr/sbin/dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file=  --listen-address 192.168.122.1 --except-interface lo --dhcp-range 192.168.122.2,192.168.122.254' exited with non-zero status 3 and signal 0: 
dnsmasq: failed to open pidfile /var/run/libvirt/network/default.pid: Permission denied
error: Failed to start network default

AVC denied:

type=AVC msg=audit(1233834788.296:56): avc:  denied  { search } for  pid=4016 comm="dnsmasq" name="libvirt" dev=dm-0 ino=1810670 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=dir

Trying again in permissive mode, it starts but with these additional AVCs:

type=AVC msg=audit(1233835237.160:58): avc:  denied  { search } for  pid=4060 comm="dnsmasq" name="libvirt" dev=dm-0 ino=1810670 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=dir
type=AVC msg=audit(1233835237.160:58): avc:  denied  { write } for  pid=4060 comm="dnsmasq" name="network" dev=dm-0 ino=1927185 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=dir
type=AVC msg=audit(1233835237.160:58): avc:  denied  { add_name } for  pid=4060 comm="dnsmasq" name="default.pid" scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=dir
type=AVC msg=audit(1233835237.160:58): avc:  denied  { create } for  pid=4060 comm="dnsmasq" name="default.pid" scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=file
type=AVC msg=audit(1233835237.160:58): avc:  denied  { write open } for  pid=4060 comm="dnsmasq" name="default.pid" dev=dm-0 ino=548891 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=file
type=AVC msg=audit(1233835237.197:59): avc:  denied  { getattr } for  pid=4060 comm="dnsmasq" path="/var/run/libvirt/network/default.pid" dev=dm-0 ino=548891 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=file
Comment 1 Mark McLoughlin 2009-02-05 07:35:41 EST
Just tried 0.6.0 from update-testing on F10 and confirmed it has the same issue
Comment 2 Daniel Berrange 2009-02-05 07:44:12 EST
This is probably caused by the change in the way we launch DNSMASQ in libvirt 0.6.0

We now let it daemonize itself, and write out a PIDfile.

Specifically

  --pidfile /var/run/libvirt/network/$NMAE.pid

So we likely need to add  /var/run/libvirt/network to the SELinux policy for DNSMASQ to be able to write to
Comment 3 Mark McLoughlin 2009-02-06 03:25:15 EST
*** Bug 484292 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Berrange 2009-02-06 05:36:39 EST
Changing to SELinux policy component, since I reckon we just need to add the dir i mention in comment #2
Comment 5 Mark McLoughlin 2009-02-06 05:52:48 EST
dwalsh: note, this is filed against rawhide but exists in F9 and F10 updates-testing too
Comment 6 Daniel Walsh 2009-02-06 11:38:22 EST
Miroslav, Just add 

virt_manage_pid_files(dnsmasq_t) for F9 and F10.

Can you add /var/run/libvirt/network to the libvirt spec file and then we can label it as such only dnsmasq can write to it.
Comment 7 Daniel Walsh 2009-02-06 11:40:09 EST
I can then add /var/run/libvirt/network(/.*)? 	gen_context(system_u:object_r:dnsmasq_var_run_t,s0)
Comment 8 Daniel Berrange 2009-02-06 14:16:02 EST
One step ahead of you about the having the directory in libvirt RPM ! We have added it to the 0.6.0-1 RPM in Fedora

# rpm -qf /var/run/libvirt/network/
libvirt-0.6.0-1.fc10.x86_64
Comment 9 Mark McLoughlin 2009-02-13 13:17:22 EST
Also fixed by selinux-policy-3.5.13-45.fc10, right ?
Comment 10 Miroslav Grepl 2009-02-16 04:29:25 EST
Yes, it is.
Comment 11 Bug Zapper 2009-11-18 05:59:35 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Note You need to log in before you can comment on or make changes to this bug.