Bug 497131 - svirt fails to relabel qcow2 backing files
Summary: svirt fails to relabel qcow2 backing files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mark McLoughlin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 525362 (view as bug list)
Depends On:
Blocks: F12VirtTarget
TreeView+ depends on / blocked
 
Reported: 2009-04-22 13:41 UTC by Mark McLoughlin
Modified: 2009-10-02 15:23 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-02 15:23:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mark McLoughlin 2009-04-22 13:41:38 UTC
If you create a qcow2 image with a backing file:

  $> qemu-img create -b f11-beta.qcow2 -f qcow2 f11-beta.snap1.qcow2

and configure a domain to use it:

    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/f11-beta.snap2.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>

and start it:

  $>  virsh start f11-beta
  error: Failed to start domain f11-beta
  error: internal error unable to start guest: qemu: could not open disk image /var/lib/libvirt/images/f11-beta.snap2.qcow2

type=AVC msg=audit(1240410685.659:86): avc:  denied  { read } for  pid=9537 comm="qemu-kvm" name="f11-beta.qcow2" dev=dm-0 ino=3466427 scontext=system_u:system_r:svirt_t:s0:c280,c287 tcontext=system_u:object_r:virt_image_t:s0 tclass=file

The problem is obvious - we're re-labelling the qcow2 image, but not its backing file.

Note, the backing file should be read-only for all guests which use a qcow2 image backed by it.

Comment 1 Bug Zapper 2009-06-09 14:24:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Mark McLoughlin 2009-09-24 07:25:04 UTC
*** Bug 525362 has been marked as a duplicate of this bug. ***

Comment 3 Mark McLoughlin 2009-09-25 13:31:07 UTC
Patches posted upstream for this:

  http://www.redhat.com/archives/libvir-list/2009-September/msg00740.html

It's fairly invasive so, while I'll backport it to F12, I won't be backporting it to F11.

Comment 4 Mark McLoughlin 2009-10-01 15:19:17 UTC
Okay, I've backported this to F-12 and will build it later today

* Thu Oct  1 2009 Mark McLoughlin <markmc> - 0.7.1-8
- Re-label qcow2 backing files (#497131)

Patch is http://gitorious.org/~markmc/libvirt/fedora/commit/5bb2da190b

Comment 5 Mark McLoughlin 2009-10-02 15:23:05 UTC
This is in rawhide now


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