Bug 672734

Summary: VM whose image is not stored in /var/lib/libvirt/images can be run successfully with SElinux enabled
Product: Red Hat Enterprise Linux 6 Reporter: Mark Wu <dwu>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0CC: eblake, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 672733 Environment:
Last Closed: 2011-04-06 02:15:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 672733    
Bug Blocks:    

Description Mark Wu 2011-01-26 05:24:19 UTC
+++ This bug was initially created as a clone of Bug #672733 +++

Description of problem:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization/sect-Virtualization-Security_for_virtualization-SELinux_and_virtualization.html

In section 16.2 SElinux and virtulization, it's said that:

SELinux prevents guest images from loading if SELinux is enabled and the images are not in the correct directory. SELinux requires that all guest images are stored in /var/lib/libvirt/images.  

Actually, by default the guest can be run wherever its image is stored because libvirtd will change the security context of the guest image into an appropriate one before it was launched. It's a feature of svirt which is integrated in libvirtd. 

If you disable svirt via changing security_driver to "none" in /etc/libvirt/qemu.conf, it will fail to run any VMs in incorrect directories. 

Actually, I am not sure it's a document problem or libvirt's problem: it shouldn't change the security attribute of the images not in storage pool.

Version-Release number of selected component (if applicable):
6.0

How reproducible:
100%

Steps to Reproduce:
1. create a new virtual machine
2. move the image to /local/images, and change the configuration of that guest to point to the new location
3. start the guest again
  
Actual results:

Expected results:



Additional info:

Comment 1 RHEL Program Management 2011-04-04 02:07:42 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.