Bug 517157
Summary: | libvirt fails to start guest on NFS even when sebool virt_use_nfs is on | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | David Lutterkort <lutter> | ||||
Component: | libvirt | Assignee: | Darryl L. Pierce <dpierce> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 11 | CC: | ajia, apevec, berrange, braden, clalance, crobinso, dpierce, dwalsh, hbrock, hedayatv, itamar, jboggs, markmc, tross, veillard, virt-maint | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | 0.6.2-19.fc11 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2009-11-04 12:38:05 UTC | Type: | --- | ||||
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: | |||||||
Bug Blocks: | 480594 | ||||||
Attachments: |
|
Description
David Lutterkort
2009-08-12 18:58:51 UTC
Didn't we fix that with more recent releases, i.e. don't try to relabel if not needed, I'm pretty sure it should be in 0.7.0 Daniel No, that was a different fix. The logic in the fix was 'if setfilecon fails, and the file already has the right label, ignore the error' What I am talking about here is for NFS mounts, where the only way to get the right label is to specify it as a mount option; that's very clunky. Instead, SELinux offers a virt_use_nfs boolean which should make it possible to use images stored on NFS. Right now, libvirt gets in the way because it tries to setfilecon even for NFS files, which always fails. The fix I suggest is to not try to setfilecon if a file is on NFS, and report an error only if the virt_use_nfs boolean is off (or just let SELinux report any problems) I'd been telling people to mount with -o context="system_u:object_r:virt_content_t:s0" but that indeed does suck; the virt_use_nfs boolean is much nicer There's some more discussion on this in bug #496340 danpb notes that we shouldn't fail to start a guest when we're in permissive mode either I would agree, just let SELinux report the problem and do not try to setfilecon on file systems that do not support xattrs. You can now tell this in Rawhide by looking for the seclabel field in /proc/mounts. if seclabel is not in the /proc/mounts field, libvirt should not try to set the label. Then SELinux will either allow or deny the action. setfilecon will fail if the mount point does not have this field. (I believe). Rather than groking /proc/mounts, we can just catch & ignore ENOSYS errno after setfilecon() call. Sounds good to me. Does the kernel return this if you try to set the label on a files system that was setup with a mount context="CONTEXT" Created attachment 358174 [details]
email to libvir-list with patch
*** Bug 507202 has been marked as a duplicate of this bug. *** Here's what got committed: http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=777fc2e9d6 Included in libvirt-0.7.1-1 (in rawhide/F12 and virt-preview for F11) *** Bug 516430 has been marked as a duplicate of this bug. *** bz is against the F11 version, so we still need the fix in F11 *** Bug 507202 has been marked as a duplicate of this bug. *** *** Bug 516430 has been marked as a duplicate of this bug. *** libvirt-0.6.2-19.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/libvirt-0.6.2-19.fc11 libvirt-0.6.2-19.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update libvirt'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-10615 libvirt-0.6.2-19.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report. |