Bug 1499800
Summary: | [OSP10][RHEL7.4] AVC denied on console.log: virtlogd + logrotation + svirt interaction problem | ||
---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Robin Cernin <rcernin> |
Component: | openstack-selinux | Assignee: | Lon Hohberger <lhh> |
Status: | CLOSED ERRATA | QA Contact: | Udi Shkalim <ushkalim> |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 10.0 (Newton) | CC: | akaris, asoni, bhaubeck, bschmaus, dcain, dvd, ebarrera, fwissing, jschluet, jsuchane, jzaher, lhh, libvirt-maint, ljozsa, mbooth, mburns, mgrepl, mlopes, morazi, mschuppe, nshetty, oblaut, pablo.iranzo, pcaruana, pmannidi, rbalakri, rcernin, rhallise, slinaber, smykhail, srevivo, ssigwald, wliu |
Target Milestone: | z7 | Keywords: | Regression, Triaged, ZStream |
Target Release: | 10.0 (Newton) | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | openstack-selinux-0.8.11-1.el7ost | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1377272 | Environment: | |
Last Closed: | 2018-02-27 16:43: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: | 1377272 | ||
Bug Blocks: |
Description
Robin Cernin
2017-10-09 12:24:00 UTC
FYI this is not the same issue. Previously, the problem was virtlogd_t could not manage nova_var_lib_t files. This issue seems peculiar to log rotation for console.log on instances. When this fails, what does 'ls -lZ /var/lib/nova/instances/98c175ec-6be0-4de0-88c9-e54774fed778' say? Basically, it sounds like virtlogd is set up to do log rotation for instances, but doesn't set the correct context (it remains in the svirt context), so when we go to boot things, the label is incorrect on disk, meaning that when Nova launches things, SELinux denies the rename/unlink. Need: * ls -lZ /var/lib/nova/instances/98c175ec-6be0-4de0-88c9-e54774fed778 * /etc/libvirt/virtlogd.conf from the affected machine(s) I'm not sure off-hand how to fix this. Eduardo pointed out that this bug was also posed to the ML in 2014: https://www.redhat.com/archives/libvir-list/2014-November/msg00500.html In my digging, I also found that Atlassian Eucalyptus (another cloud system) hits this, too: https://eucalyptus.atlassian.net/browse/EUCA-13447 However, I believe this bug is in libvirtd/virtlogd, and not in SELinux policies. You may want to have a look at: https://bugzilla.redhat.com/show_bug.cgi?id=1501957 I hit this issue with OSP 10 and OSP 8, both after an upgrade to RHEL 7.4 I'm not setting them as a duplicate of this bug yet. Feel free to do so, though. I think 1501957 is a duplicate of this. If this is new in RHEL 7.4, then we may want to note that it is a regression. Reported here, too: https://bugs.launchpad.net/kolla-ansible/+bug/1668654 Please make sure that the directory with console.log files are correctly labelled with virt_log_d selinux label. This requirement is described in the following chapter of virtualization deployment guide. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-manipulating_the_domain_xml-devices#sect-Devices-Host_physical_machine_interface *** This bug has been marked as a duplicate of bug 1371125 *** I am moving this issue back to Open Stack product as there is nothing libvirt can if nova puts log file in a custom directory. It is mandatory that the directory is labeled with virt_log_d. From the Eucalyptus bug, seems that this bugfix is what changed the behavior in 7.4 vs 7.3: https://bugzilla.redhat.com/show_bug.cgi?id=1420205 It also appears one can work around the behavior change by adding log rotation capability to selinux policies: allow virtlogd_t self:capability dac_override; create_files_pattern(virtlogd_t, virt_image_t, virt_log_t) delete_files_pattern(virtlogd_t, virt_image_t, virt_log_t) rename_files_pattern(virtlogd_t, virt_image_t, virt_log_t) delete_files_pattern(virtlogd_t, virt_image_t, svirt_image_t) rename_files_pattern(virtlogd_t, virt_image_t, svirt_image_t) filetrans_pattern(virtlogd_t, virt_image_t, virt_log_t, file, "console.log") This makes sense: https://danwalsh.livejournal.com/73796.html https://github.com/redhat-openstack/openstack-selinux/commit/ce3cff747f48594b21ebced8e81842db30f87aeb https://github.com/redhat-openstack/openstack-selinux/commit/974060c318399a877ba1dc1de309f3964b7c4dc2 https://github.com/redhat-openstack/openstack-selinux/commit/904af4727741e38887d57072f42c60383da16f13 *** Bug 1501957 has been marked as a duplicate of this bug. *** http://people.redhat.com/lhh/openstack-selinux-0.8.11-1.el7ost.src.rpm http://people.redhat.com/lhh/openstack-selinux-0.8.11-1.el7ost.noarch.rpm http://people.redhat.com/lhh/openstack-selinux-test-0.8.11-1.el7ost.noarch.rpm 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://access.redhat.com/errata/RHBA-2018:0365 |