Bug 1040177 - SELinux is preventing /usr/sbin/logrotate from 'read' accesses on the directory /var/log/core.
Summary: SELinux is preventing /usr/sbin/logrotate from 'read' accesses on the directo...
Keywords:
Status: CLOSED DUPLICATE of bug 1131460
Alias: None
Product: Fedora
Classification: Fedora
Component: vdsm
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Yaniv Bronhaim
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: infar abrt_hash:300787c783d6afac04e5f...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-10 21:30 UTC by Axel Sommerfeldt
Modified: 2015-01-12 16:56 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-01-12 16:56:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Axel Sommerfeldt 2013-12-10 21:30:43 UTC
Description of problem:
SELinux is preventing /usr/sbin/logrotate from 'read' accesses on the directory /var/log/core.

*****  Plugin catchall (100. confidence) suggests  ***************************

If sie denken, dass es logrotate standardmässig erlaubt sein sollte, read Zugriff auf core directory zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
Do
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# grep logrotate /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:logrotate_t:s0-s0:c0.c1023
Target Context                system_u:object_r:virt_cache_t:s0
Target Objects                /var/log/core [ dir ]
Source                        logrotate
Source Path                   /usr/sbin/logrotate
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           logrotate-3.8.4-3.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-74.14.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.10-200.fc19.x86_64 #1 SMP Mon
                              Dec 2 20:28:03 UTC 2013 x86_64 x86_64
Alert Count                   5
First Seen                    2013-12-10 18:01:02 CET
Last Seen                     2013-12-10 22:01:01 CET
Local ID                      88d0a65f-89bc-4ee5-b071-7652d3ae22e9

Raw Audit Messages
type=AVC msg=audit(1386709261.366:1047): avc:  denied  { read } for  pid=7280 comm="logrotate" name="core" dev="sda2" ino=812853 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(1386709261.366:1047): arch=x86_64 syscall=openat success=no exit=EACCES a0=ffffffffffffff9c a1=7fffd7f88ba0 a2=90800 a3=0 items=0 ppid=7278 pid=7280 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=53 tty=(none) comm=logrotate exe=/usr/sbin/logrotate subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)

Hash: logrotate,logrotate_t,virt_cache_t,dir,read

Additional info:
reporter:       libreport-2.1.9
hashmarkername: setroubleshoot
kernel:         3.11.10-200.fc19.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-12-11 21:32:42 UTC
This could be a mislabeling issue.

restorecon -R -v /var/log

Does this change the label?

Comment 2 Axel Sommerfeldt 2013-12-16 20:58:32 UTC
No, this does not change the SELinux label and does not fix the problem. I've done restoring the labels of /var/log (using the command above) but the directory /var/log/core still has the same SELinux label system_u:object_r:virt_cache_t:s0 (and no content inside) and I still get the SELinux notification periodically.

(But I will install F20 tomorrow anyway.)

Comment 3 Axel Sommerfeldt 2013-12-16 21:08:24 UTC
I did further investigation and found out that I get the SELinux alert every hour. It seems to be caused by /etc/cron.hourly/vdsm-logrotate, so I assume it's not a F19 but a oVirt issue since "yum info vdsm" says:

Name       : vdsm
Architektur : x86_64
Version    : 4.13.0
Ausgabe    : 11.fc19
Größe : 2.8 M
Quelle      : installed
Aus Quelle  : ovirt-stable
Zusammenfassung: Virtual Desktop Server Manager
URL        : http://www.ovirt.org/wiki/Vdsm

Comment 4 Daniel Walsh 2014-01-02 22:56:28 UTC
Does

semanage fcontext -l -C 

Show anything?

Comment 5 Paul Stauffer 2014-05-13 17:35:57 UTC
I ran across this bug entry when looking to see if one had been filed for RHEL6. FYI, I'm getting the same behavior on a RHEL 6 hypervisor running RHEV 3.3, so Axel's point about oVirt may hold. Dan, I ran "semanage fcontext -l -C" as you suggest, and it produced the following output:

SELinux fcontext                                   type               Context

/var/log/core(/.*)?                                all files          system_u:object_r:virt_cache_t:s0 


(I won't clear the needinfo flag, since my results on RHEL 6 may not necessarily be relevant to this F19 bug.)

Comment 6 Daniel Walsh 2014-05-17 10:31:29 UTC
This means some package in its postinstall is setting this label or some admin did it.

Comment 7 Paul Stauffer 2014-05-17 11:15:48 UTC
It's the vdsm package that's doing it:

$ rpm -q --scripts vdsm
[snip]
# hack until we replace core dump with abrt
if /usr/sbin/selinuxenabled; then
    /usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
fi
/sbin/restorecon -R /var/log/core >/dev/null 2>&1

(I checked the Fedora 20 and RHEL 6 packages, both have the same thing, so I'll clear the needinfo flag.)

Comment 8 Daniel Walsh 2014-05-19 17:28:38 UTC
Not sure why they did not pick virt_log_t.

Comment 9 Miroslav Grepl 2014-05-20 11:04:31 UTC
I think there was a reason for it. Lets ask.

Comment 10 Fedora End Of Life 2015-01-09 20:49:51 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Yaniv Bronhaim 2015-01-12 16:56:40 UTC

*** This bug has been marked as a duplicate of bug 1131460 ***


Note You need to log in before you can comment on or make changes to this bug.