Bug 518014 - Allow svirt images to create sock_file in svirt_var_run_t
Allow svirt images to create sock_file in svirt_var_run_t
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F11VirtTarget
  Show dependency treegraph
 
Reported: 2009-08-18 09:33 EDT by Perry Myers
Modified: 2009-09-03 08:09 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-03 08:09:19 EDT
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 Perry Myers 2009-08-18 09:33:04 EDT
Description of problem:
When trying to start a kvm domain via virsh when SELinux is in Enforcing mode, the domain fails to start with the following errors:

[root@sdp1 ~]# virsh start f11
error: Failed to start domain f11
error: internal error unable to start guest: bind(unix:/var/run/libvirt/qemu/f11.monitor): Permission denied
qemu: could not open monitor device 'unix:/var/run/libvirt/qemu/f11.monitor,server,nowait'

avc logs are;
Aug 18 09:28:46 sdp1 libvirtd: 09:28:46.164: error : qemudReadLogOutput:816 : internal error Process exited while reading console log output
Aug 18 09:28:46 sdp1 libvirtd: 09:28:46.164: error : qemudWaitForMonitor:1103 : internal error unable to start guest: bind(unix:/var/run/libvirt/qemu/f11.monitor): Permission denied#012qemu: could not open monitor device 'unix:/var/run/libvirt/qemu/f11.monitor,server,nowait'#012
Aug 18 09:28:47 sdp1 setroubleshoot: SELinux is preventing qemu-kvm (svirt_t) "create" svirt_var_run_t. For complete SELinux messages. run sealert -l 698e9589-b6f0-43d6-8d8c-8a403774f74e

node=sdp1 type=AVC msg=audit(1250602126.69:60873): avc:  denied  { create } for  pid=9920 comm="qemu-kvm" name="f11.monitor" scontext=system_u:system_r:svirt_t:s0:c751,c922 tcontext=system_u:object_r:svirt_var_run_t:s0:c751,c922 tclass=sock_file

node=sdp1 type=SYSCALL msg=audit(1250602126.69:60873): arch=c000003e syscall=49 success=no exit=-13 a0=9 a1=7fff624548e0 a2=6e a3=7fff62454670 items=0 ppid=1 pid=9920 auid=11912 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="qemu-kvm" exe="/usr/bin/qemu-kvm" subj=system_u:system_r:svirt_t:s0:c751,c922 key=(null)

Version-Release number of selected component (if applicable):
libvirt-0.7.0-3.fc11.x86_64
qemu-kvm-0.10.91-0.5.rc1.fc11.x86_64
selinux-policy-targeted-3.6.12-72.fc11.noarch
selinux-policy-3.6.12-72.fc11.noarch

How reproducible:
Every time

Steps to Reproduce:
1. Enable selinux via setenforce Enforcing
2. virsh start <domain>
3.
  
Actual results:
Errors listed above

Expected results:
Domain should start

Additional info:
Comment 1 Mark McLoughlin 2009-08-18 09:50:30 EDT
The fix for this in Fedora 12 was this:

   * Wed Aug 5 2009 Dan Walsh <dwalsh@redhat.com> 3.6.26-5
   - Allow svirt images to create sock_file in svirt_var_run_t

Can we get this applied in Fedora 11 too for users of the virt-preview repository?

(The idea with the virt-preview repo is that Fedora 11 users can try out the new Fedora 12 virt bits without breaking non-virt things on their system)
Comment 2 Miroslav Grepl 2009-08-18 09:57:17 EDT
It was fixed in selinux-policy-3.6.12-74.fc11

  * Wed Aug 05 2009 Miroslav Grepl <mgrepl@redhat.com> 3.6.12-74 
    - Allow svirt images to create sock_file in svirt_var_run_t
Comment 3 Mark McLoughlin 2009-08-18 10:24:46 EDT
Ah, okay thanks

https://admin.fedoraproject.org/updates/F11/FEDORA-2009-8536
Comment 4 Mark McLoughlin 2009-09-03 08:09:19 EDT
Since pushed to stable

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