Bug 445877 - Add /var/lib/libvirt/boot dir to policy for kernel+initrd images for booting KVM
Summary: Add /var/lib/libvirt/boot dir to policy for kernel+initrd images for booting...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 445854
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-09 15:38 UTC by Daniel Berrangé
Modified: 2008-11-17 22:03 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-11-17 22:03:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2008-05-09 15:38:40 UTC
We need to have a 

  /var/lib/libvirt/boot

directory added to the SELinux Policy for KVM/QEMU for storing kernel+initrd
files for purposes of booting the installer. KVM/QEMU should have ability to
read files in that directory, but not write to them.



+++ This bug was initially created as a clone of Bug #445854 +++

Description of problem:
virt-install --location produces avc: denied { read } for pid=5220
comm="qemu-kvm" name="virtinst-vmlinuz.dOPar5" dev=sda1 ino=196841
scontext=system_u:system_r:qemu_t:s0
tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file 

kernel and initrd are downloaded to /var/tmp/ and get wrong SElinux context
user_tmp_t instead of expected 

Version-Release number of selected component (if applicable):
kvm-65-1.fc9
python-virtinst-0.300.3-5.fc9
selinux-policy-targeted-3.3.1-42.fc9

How reproducible:
install KVM guest using --location option

Steps to Reproduce:
1. virt-install -n testVM -r 768 -f /var/lib/libvirt/images/testVM.img -s 6
--vnc  --accelerate -v --os-type=linux --arch=i686 -w network:default -l
http://download.fedora.redhat.com/pub/fedora/linux/development/i386/os/
  
Actual results:


Expected results:


Additional info:
quickfix, might be wrong:

diff -r 309cf2ed646a virtinst/Guest.py
--- a/virtinst/Guest.py Thu May 08 14:18:30 2008 -0400
+++ b/virtinst/Guest.py Fri May 09 15:37:50 2008 +0200
@@ -508,7 +508,7 @@ class Installer(object):
     def get_scratchdir(self):
         if self.type == "xen":
             return "/var/lib/xen"
-        return "/var/tmp"
+        return "/var/lib/libvirt/images"
     scratchdir = property(get_scratchdir)
 
     def get_cdrom(self):

-- Additional comment from berrange on 2008-05-09 11:36 EST --
This shouldn't really use /var/lib/libvirt/images since that's for disk images.
THe kernel & initrd should really be in their own directory. I'll get Dan to add
a new directory to the SELinux policy for this

Comment 1 Daniel Walsh 2008-05-09 15:50:38 UTC
If it is read/only access the default virt_var_lib_t would be fine.  So just add
the dir/files and I will allow qemu_t read access to these files.

Comment 2 Daniel Berrangé 2008-05-09 17:57:27 UTC
I've added /var/lib/libvirt/boot  to libvirt-0.4.2-3.fc9 and -4.fc10, so it'll
pickup the context set in the policy on next upgrade.


Comment 3 Daniel Walsh 2008-05-13 14:30:43 UTC
Fixed in selinux-policy-3.3.1-50.fc9.noarch

Comment 4 Bug Zapper 2008-05-14 10:55:13 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Daniel Walsh 2008-11-17 22:03:45 UTC
Closing all bugs that have been in modified for over a month.  Please reopen if the bug is not actually fixed.


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