Bug 312581

Summary: SELinux is preventing /usr/sbin/logrotate (logrotate_t) "getattr" to /var/log/rpmpkgs (root_t).
Product: [Fedora] Fedora Reporter: Matthew Saltzman <mjs>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: low    
Version: 8   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-01 19:47:32 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:

Description Matthew Saltzman 2007-09-29 20:51:10 UTC
Description of problem:
SELinux denied access requested by /usr/sbin/logrotate. It is not expected that
this access is required by /usr/sbin/logrotate and this access may signal an
intrusion attempt. It is also possible that the specific version or
configuration of the application is causing it to require additional access.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.0.8-14.fc8.noarch

How reproducible:
Always

Steps to Reproduce:
1. /etc/cron.daily/logrotate
2.
3.
  
Actual results:
AVC

Expected results:
no AVC

Additional info:
Source Context:  system_u:system_r:logrotate_t:s0
Target Context:  system_u:object_r:root_t:s0
Target Objects:  /var/log/rpmpkgs [ file ]
Affected RPM Packages:  logrotate-3.7.6-1.1.fc8 [application]
Policy RPM:  selinux-policy-3.0.8-14.fc8
Selinux Enabled:  True
Policy Type:  targeted
MLS Enabled:  True
Enforcing Mode:  Enforcing
Plugin Name:  plugins.catchall_file
Host Name:  valkyrie.localdomain
Platform:  Linux valkyrie.localdomain 2.6.23-0.213.rc8.git2.fc8 #1 SMP Thu Sep
27 22:47:16 EDT 2007 x86_64 x86_64
Alert Count:  2
First Seen:  Sat 29 Sep 2007 03:55:14 PM EDT
Last Seen:  Sat 29 Sep 2007 03:55:14 PM EDT
Local ID:  6fea02fb-b833-4b44-8812-571a8f6b8c66
Line Numbers:  
Raw Audit Messages :avc: denied { getattr } for comm=logrotate dev=dm-0 egid=0
euid=0 exe=/usr/sbin/logrotate exit=-13 fsgid=0 fsuid=0 gid=0 items=0
path=/var/log/rpmpkgs pid=3186 scontext=system_u:system_r:logrotate_t:s0 sgid=0
subj=system_u:system_r:logrotate_t:s0 suid=0 tclass=file
tcontext=system_u:object_r:root_t:s0 tty=(none) uid=0

Comment 1 Daniel Walsh 2007-10-01 19:47:32 UTC
This is a badly labeled file.  I have no idea how it got labeled root_t

restorecon -R -v /var/log 

Should fix the labeling.

Comment 2 Matthew Saltzman 2007-10-01 20:29:13 UTC
That did it.  But the incorrect labeling is still a mystery.  I certainly did
nothing I'm aware of to cause it.  And I saw another report on
fedora-selinux-list describing the same issue, so it's bound to recur.