Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
the qcow2 disk's major:minor number still exists in guest's devices.list after hot-unplug
Version-Release number of selected component (if applicable):
libvirt-0.10.2-8.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. install a guest using virsh, virt-install or virt-manager
2. get host disk infomation (such as /dev/sda)
# df -h
3. create a qcow2 format image and let it point at /dev/sda
# qemu-img create -f qcow2 /var/lib/libvirt/images/foo.qcow2 -o backing_file=/dev/sda
4. check whether demo.qcow2 disk pointing at /dev/sda and disk format is qcow2
# qemu-img info /var/lib/libvirt/images/foo.qcow2
5. editor the following xml block to foo.xml
# cat foo.xml
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/foo.qcow2'/>
<target dev='vdb' bus='virtio'/>
</disk>
6. get the above disk /dev/sda major:minor number
#ls -la /dev/sda
7. check whether the above major:minor(8:0) number exists in devices.list
# grep "8:0" /cgroup/devices/libvirt/qemu/demo/devices.list
8. attach the above foo.xml to the guest
# virsh attach-device demo foo.xml
9. check whether the above major:minor(8:0) number exists in devices.list
# grep "8:0" /cgroup/devices/libvirt/qemu/demo/devices.list
10. detach foo.xml from the guest
# virsh detach-device demo foo.xml
11. check whether the above major:minor(8:0) number exists in devices.list
# grep "8:0" /cgroup/devices/libvirt/qemu/demo/devices.list
Actual results:
b 8:0 rw
Expected results:
no results
Additional info:
This works on libvirt-0.9.10-21.el6.x86_64.rpm, so it's a regression bug.
Daniel, although I can reproduce this question on libvirt-0.10.2-8 and it's okay on libvirt RHEL6.3 release version(libvirt-0.9.10-21), I still want to confirm if it's a regression bug with you, thanks.
Alex
Failure to revoke cgroup device ACLs on hotplug does sound like a regression; thankfully it is not a security issue (once access has been granted, failure to revoke cgroup ACLs merely means that a compromised qemu can continue to open() the device; but if qemu already has an fd to the device, it doesn't need to open() the device, so there is no escalation in what a compromised qemu can already do). I have not yet looked in the code to see what may have caused the regression, or how easy it would be to plug.
(In reply to comment #5)
> Failure to revoke cgroup device ACLs on hotplug does sound like a
> regression; thankfully it is not a security issue (once access has been
> granted, failure to revoke cgroup ACLs merely means that a compromised qemu
> can continue to open() the device; but if qemu already has an fd to the
> device, it doesn't need to open() the device, so there is no escalation in
> what a compromised qemu can already do). I have not yet looked in the code
> to see what may have caused the regression, or how easy it would be to plug.
Eric, thanks for your comments.
I've confirmed the regression in my testing; it looks like the hot unplug code is failing to populate the new disk->backingChain element (or better, reusing the existing disk->backingChain that was created during hot plug). I expect to have a fix in the next 24 hours.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHSA-2013-0276.html
Description of problem: the qcow2 disk's major:minor number still exists in guest's devices.list after hot-unplug Version-Release number of selected component (if applicable): libvirt-0.10.2-8.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. install a guest using virsh, virt-install or virt-manager 2. get host disk infomation (such as /dev/sda) # df -h 3. create a qcow2 format image and let it point at /dev/sda # qemu-img create -f qcow2 /var/lib/libvirt/images/foo.qcow2 -o backing_file=/dev/sda 4. check whether demo.qcow2 disk pointing at /dev/sda and disk format is qcow2 # qemu-img info /var/lib/libvirt/images/foo.qcow2 5. editor the following xml block to foo.xml # cat foo.xml <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/foo.qcow2'/> <target dev='vdb' bus='virtio'/> </disk> 6. get the above disk /dev/sda major:minor number #ls -la /dev/sda 7. check whether the above major:minor(8:0) number exists in devices.list # grep "8:0" /cgroup/devices/libvirt/qemu/demo/devices.list 8. attach the above foo.xml to the guest # virsh attach-device demo foo.xml 9. check whether the above major:minor(8:0) number exists in devices.list # grep "8:0" /cgroup/devices/libvirt/qemu/demo/devices.list 10. detach foo.xml from the guest # virsh detach-device demo foo.xml 11. check whether the above major:minor(8:0) number exists in devices.list # grep "8:0" /cgroup/devices/libvirt/qemu/demo/devices.list Actual results: b 8:0 rw Expected results: no results Additional info: This works on libvirt-0.9.10-21.el6.x86_64.rpm, so it's a regression bug.