Bug 1108593
Summary: | Libvirtd will crash while start a guest which DAC's seclabel type='none' in guest's xml | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | zhenfeng wang <zhwang> |
Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.0 | CC: | dyuan, jtomko, mzhan, rbalakri, vivianzhang, ydu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.2.7-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | 1108590 | Environment: | |
Last Closed: | 2015-03-05 07:37:33 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1108590 | ||
Bug Blocks: |
Description
zhenfeng wang
2014-06-12 09:51:41 UTC
Fixed upstream by: commit 7eb0ee175b278a4439cee65a7a554767f0be9cd1 Author: Ján Tomko <jtomko> AuthorDate: 2014-06-12 10:50:43 +0200 Commit: Ján Tomko <jtomko> CommitDate: 2014-06-12 12:01:35 +0200 Fix crash when saving a domain with type none dac label qemuDomainGetImageIds did not check if there was a label in the seclabel, thus crashing on <seclabel type='none' model='dac'/> https://bugzilla.redhat.com/show_bug.cgi?id=1108590 git describe: v1.2.5-112-g7eb0ee1 I could reproduce it with libvirt-1.1.1-29.el7.x86_64 as following steps: 1.Prepare a guest with the following content in the guest's xml #virsh dumpxml rhel6 -- <seclabel type='none' model='dac'/> 2.Start the guest #virsh start rhel6 3.Save the guest, the libvirtd crashed # virsh save rhel6 /tmp/rh6.save error: Failed to save domain rhel6 to /tmp/rh6.save error: End of file while reading data: Input/output error error: One or more references were leaked after disconnect from the hypervisor error: Failed to reconnect to the hypervisor Actual results: libvirtd crashed Verified this issue with libvirt-1.2.7-1.el7.x86_64: 1.Prepare a guest with the following content in the guest's xml #virsh dumpxml rhel6 -- <seclabel type='none' model='dac'/> 2.Start the guest #virsh start rhel6 3.Save the guest: # virsh save rhel6 /tmp/rh6.save Domain rhel6 saved to /tmp/rh6.save hi, Jan Tomko When I try to do regression about this bug on rhel7.1, I found guest start failed with following steps, could you please help check it? thanks in advance Version-Release number of selected component (if applicable): kernel-3.10.0-188.el7.x86_64 qemu-img-rhev-2.1.2-3.el7.x86_64 libvirt-1.2.8-5.el7.x86_64 How reproducible: Steps to Reproduce: 1. set selinux driver in qemu.conf security_driver = "selinux" 2. prepare a guest with below content in guest xml: #virsh dumpxml rhel6 -- <seclabel type='none' model='dac'/> 3. check the img for this guest: # ll -Z -rw-------. root root system_u:object_r:virt_image_t:s0 rhel6.img 4. start the guest failed, with error report: # virsh start rhel6 error: Failed to start domain rhel6 error: internal error: process exited while connecting to monitor: 2014-10-17T06:02:33.600551Z qemu-kvm: -drive file=/var/lib/libvirt/images/rhel6.img,if=none,id=drive-ide0-0-0,format=qcow2,cache=none: could not open disk image /var/lib/libvirt/images/rhel6.img: Could not open '/var/lib/libvirt/images/rhel6.img': 5. check the img again, still root/root: # ll -Z -rw-------. root root system_u:object_r:virt_image_t:s0 rhel6.img 6. guest with the same steps can start success on rhel6.6 libvirt-0.10.2-46.el6.x86_64, img can change id and group to qemu/qemu automatically I am wondering is it a new issue for selinux DAC mode on rhel7.1? vivian zhang I don't think libvirt should change the uid and gid with type='none' model='dac' seclabel. So this is an issue of RHEL-6.6 libvirt, but not really worth fixing in my opinion. This was fixed by honoring the 'relabel' attribute for model='dac' labels for bug https://bugzilla.redhat.com/show_bug.cgi?id=999301 (In reply to Jan Tomko from comment #7) > I don't think libvirt should change the uid and gid with type='none' > model='dac' seclabel. So this is an issue of RHEL-6.6 libvirt, but not > really worth fixing in my opinion. > > This was fixed by honoring the 'relabel' attribute for model='dac' labels > for bug https://bugzilla.redhat.com/show_bug.cgi?id=999301 hi, Jan Thanks so much for your reply. I am fully agree with your opinion about type='none' model='dac' seclable did not change uid and gid on rhel7.1. But if customer set <seclabel type='none' mode='dac'/> for guest, for rhel7.1 guest will start fail, the result is different with rhel6.6. I am wondering it will really confused customer's understanding. So we hope to file a bug on RHEL6.7 to fix this issue. Hope for your reply. vivian zhang Hi, Jan I can produce this bug on build libvirt-1.1.1-29.el7.x86_64 reset it on build libvirt-1.2.8-10.el7.x86_64 qemu-img-rhev-2.1.2-15.el7.x86_64 1.set selinux driver in qemu.conf security_driver = "selinux" 2. prepare a guest with below content in guest xml: #virsh dumpxml vm1 -- <seclabel type='none' model='dac'/> 3. check the img for this guest: # ll -Z /var/lib/libvirt/images/rhel65.img -rw-------. root root system_u:object_r:virt_image_t:s0 /var/lib/libvirt/images/rhel65.img 4. start the guest with error, this is an expected result on RHEL7.1 # virsh start vm1 error: Failed to start domain vm1 error: internal error: process exited while connecting to monitor: 2014-12-09T03:09:36.416068Z qemu-kvm: -drive file=/var/lib/libvirt/images/rhel65.img,if=none,id=drive-ide0-0-0,format=raw: could not open disk image /var/lib/libvirt/images/rhel65.img: Could not open '/var/lib/libvirt/images/rhel65.img': Permission denied 5. change the img label to qemu qemu manually # chown qemu:qemu /var/lib/libvirt/images/rhel65.img # ll -Z /var/lib/libvirt/images/rhel65.img -rw-------. qemu qemu system_u:object_r:virt_image_t:s0 /var/lib/libvirt/images/rhel65.img 6. check libvirtd process id # ps aux |grep libvirtd root 23919 0.0 0.1 1057124 18756 ? Ssl 10:46 0:00 /usr/sbin/libvirtd --listen root 24428 0.0 0.0 112644 960 pts/1 R+ 11:24 0:00 grep --color=auto libvirtd 7. start guest again, it will success # virsh start vm1 Domain vm1 started 8. save guest to file # virsh save vm1 /tmp/vm1.save Domain vm1 saved to /tmp/vm1.save 9. recheck libvirtd process, does not crashed anymore # ps aux |grep libvirtd root 23919 0.0 0.1 1122660 18848 ? Ssl 10:46 0:00 /usr/sbin/libvirtd --listen root 24471 0.0 0.0 112644 956 pts/1 S+ 11:25 0:00 grep --color=auto libvirtd so, according to commet7, do you think the above steps are valid to verify this bug on RHEL7.1, are these enough to move this bug to verified? But this is still a known issue for RHEL6.6, how could we follow it? We insist on file a bug about this on RHEL6.7, what is your opinion? vivian zhang Yes, the steps are enough to verify it on RHEL7. As said in comment 7, the behavior in RHEL6 is not worth fixing. since this bug works OK for rhel7, change to verified 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. https://rhn.redhat.com/errata/RHSA-2015-0323.html |