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.
+++ This bug was initially created as a clone of Bug #1064326 +++
The problem described in Bug #1064326 remains.
On any system with vdsm (currently 4.14.13-2.el6ev) installed and selinux enabled, the following still appears every hour in /var/log/messages:
setroubleshoot: SELinux is preventing /usr/sbin/logrotate from read access on the directory /var/log/core.
From /var/log/audit/audit.log:
type=AVC msg=audit(1413399661.335:7626): avc: denied { read } for pid=4640 comm="logrotate" name="core" dev=dm-1 ino=919070 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:virt_cache_t:s0 tclass=dir
type=SYSCALL msg=audit(1413399661.335:7626): arch=c000003e syscall=2 success=no exit=-13 a0=7fff20a390f0 a1=90800 a2=12128fe a3=fffffffffffffff0 items=0 ppid=4638 pid=4640 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=571 comm="logrotate" exe="/usr/sbin/logrotate" subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)
According to Bug # 1064326, this was supposedly fixed in selinux-policy-3.7.19-260.el6, but as far as I can tell, nothing has changed. Can someone please explain what the attempted solution was that was supposed to have been included in that release to close the previous bug? Was the intention to allow logrotate read access on virt_cache_t? Without an update to the vdsm package, the /var/log/core directory remains virt_cache_t.
Almost 8 months ago I filed 3 bugs related to this problem:
* BZ#1066407
* BZ#1064322
* BZ#1064326
The problem is in the vdsm package, it brings own labeling pattern:
# rpm -q --scripts vdsm | grep semanage
/usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
#
Actual results:
* /var/log/core directory is labeled incorrectly, which causes SELinux denials in enforcing mode, which means that core files in that directory are not processed by logrotate at all
Expected results:
* do not call semanage at all, /var/log/core directory will be labeled correctly by selinux-policy
Currently, /var/log/core is labeled var_log_t, which allows the logrotate cron job to do what's necessary. Why does vdsm need to change the label on /var/log/core ?
Someone correct me if I'm wrong, but I believe that semanage hack was introduced by vdsm because otherwise libvirt cannot write to a var_log_t /var/log/core. This was probably the wrong approach to take, and is certainly the source of the logrotate problem.
I'm guessing the proper solution is to create a new selinux type that can satisfy all of the needs here, which is why bug 1064326 and this one were filed against selinux-policy. Not sure why 1064326 was marked fixed when the underlying problem remains, but perhaps someone can explain what solution if any was attempted.
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/RHBA-2015-1375.html