Bug 842831

Summary: RFE: security: don't change owner/label unless it's needed for launching qemu (like for /dev/sr0)
Product: [Community] Virtualization Tools Reporter: Cristian Ciupitu <cristian.ciupitu>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, clalancette, crobinso, dougsland, erik.hugne, itamar, jdenemar, jforbes, laine, libvirt-maint, rbalakri, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-14 16:09:13 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Cristian Ciupitu 2012-07-24 12:57:02 EDT
Description of problem:
When I'm adding a CD image to a guest, libvirt changes its owner and SELinux
label even if it's not needed. The file is world-readable (even if it's owned
by root) and the SELinux label is public_content_t. libvirt should mess with
files as little as possible in my opinion.

The same should be done for hard-disk images probably, but I'm not interested
in that use case right now.

Version-Release number of selected component (if applicable):
libvirt-0.9.11.4-3.fc17.x86_64.rpm
Comment 1 Jiri Denemark 2012-07-25 03:19:49 EDT
Libvirt tries to isolate running domains as much as possible, which includes labeling resources used by each domain in such a way that other domains cannot read them. If you don't want this to happen for your CD image, adding <shareable/> element into the cdrom device element should work.
Comment 2 Cristian Ciupitu 2012-08-22 19:46:44 EDT
virsh dumpxml says:

    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/mnt/.../xxx.iso'>
        <seclabel relabel='yes'/>
      </source>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <shareable/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

yet the file is owned by qemu:qemu and has the label
system_u:object_r:svirt_image_t:s0.

Also I don't think that CD images need isolation by default.
Comment 3 Fedora End Of Life 2013-07-03 19:45:02 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 '17'.

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 17'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 17 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, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

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.
Comment 4 Cole Robinson 2013-07-11 14:24:22 EDT
Still not fixed, but this is a non-backportable bug so let's track it upstream.
Comment 5 Cole Robinson 2016-03-23 18:33:09 EDT
I sent an email about this to libvir-list last year, laying out a high level plan: https://www.redhat.com/archives/libvir-list/2015-April/msg01400.html
Comment 6 Cole Robinson 2016-04-10 13:48:47 EDT
*** Bug 1063710 has been marked as a duplicate of this bug. ***
Comment 7 Cole Robinson 2016-04-14 16:09:13 EDT

*** This bug has been marked as a duplicate of bug 755535 ***