Bug 501151 - SELinux is preventing touch (logrotate_t) "write" to ./run (var_run_t).
SELinux is preventing touch (logrotate_t) "write" to ./run (var_run_t).
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
10
i686 Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-17 05:02 EDT by Daniel Stripes
Modified: 2009-12-11 09:42 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-11 09:42:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Daniel Stripes 2009-05-17 05:02:49 EDT
Summary:

SELinux is preventing touch (logrotate_t) "write" to ./run (var_run_t).

Detailed Description:

SELinux is preventing touch (logrotate_t) "write" to ./run (var_run_t). The
SELinux type var_run_t, is a generic type for all files in the directory and
very few processes (SELinux Domains) are allowed to write to this SELinux type.
This type of denial usual indicates a mislabeled file. By default a file created
in a directory has the gets the context of the parent directory, but SELinux
policy has rules about the creation of directories, that say if a process
running in one SELinux Domain (D1) creates a file in a directory with a
particular SELinux File Context (F1) the file gets a different File Context
(F2). The policy usually allows the SELinux Domain (D1) the ability to write,
unlink, and append on (F2). But if for some reason a file (./run) was created
with the wrong context, this domain will be denied. The usual solution to this
problem is to reset the file context on the target file, restorecon -v './run'.
If the file context does not change from var_run_t, then this is probably a bug
in policy. Please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against the selinux-policy
package. If it does change, you can try your application again to see if it
works. The file context could have been mislabeled by editing the file or moving
the file from a different directory, if the file keeps getting mislabeled, check
the init scripts to see if they are doing something to mislabel the file.

Allowing Access:

You can attempt to fix file context by executing restorecon -v './run'

Fix Command:

restorecon './run'

Additional Information:

Source Context                system_u:system_r:logrotate_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_run_t:s0
Target Objects                ./run [ dir ]
Source                        touch
Source Path                   /bin/touch
Port                          <Unknown>
Host                          antares.milky.way
Source RPM Packages           coreutils-6.12-20.fc10
Target RPM Packages           
Policy RPM                    selinux-policy-3.5.13-58.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   mislabeled_file
Host Name                     antares.milky.way
Platform                      Linux antares.milky.way
                              2.6.27.21-170.2.56.fc10.i686 #1 SMP Mon Mar 23
                              23:37:54 EDT 2009 i686 athlon
Alert Count                   3
First Seen                    Sun 26 Apr 2009 04:05:57 AM EDT
Last Seen                     Sun 17 May 2009 04:05:45 AM EDT
Local ID                      2fabed73-9e5c-4f95-bf71-d208e580cd31
Line Numbers                  

Raw Audit Messages            

node=antares.milky.way type=AVC msg=audit(1242547545.868:894): avc:  denied  { write } for  pid=5982 comm="touch" name="run" dev=dm-0 ino=94093325 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_run_t:s0 tclass=dir

node=antares.milky.way type=SYSCALL msg=audit(1242547545.868:894): arch=40000003 syscall=5 success=no exit=-13 a0=bf95df5e a1=8941 a2=1b6 a3=8941 items=0 ppid=5981 pid=5982 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=139 comm="touch" exe="/bin/touch" subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)

Description of problem:  


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:  logrotate is being run as a cron job.
Comment 1 Miroslav Grepl 2009-09-03 05:28:19 EDT
I apologize, I missed this bug.

Could you try to execute

# restorecon -R -v /var/run/
Comment 2 Bug Zapper 2009-11-18 06:58:13 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

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 prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 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 please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

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