Bug 546550

Summary: SELinux is preventing /bin/mount access to a leaked /tmp/puppet.5428.0 file descriptor.
Product: [Fedora] Fedora Reporter: Ricky Zhou <rzhou>
Component: puppetAssignee: Jeroen van Meeuwen <vanmeeuwen+fedora>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 12CC: dwalsh, k.georgiou, mgrepl, tmz, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:2715079edad04994d386f6904de02ef5dca4734429d557697a7450ea8b5fde4e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-04 01:49:20 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 Ricky Zhou 2009-12-11 07:37:10 UTC
Summary:

SELinux is preventing /bin/mount access to a leaked /tmp/puppet.5428.0 file
descriptor.

Detailed Description:

[mount has a permissive type (mount_t). This access was not denied.]

SELinux denied access requested by the mount command. It looks like this is
either a leaked descriptor or mount output was redirected to a file it is not
allowed to access. Leaks usually can be ignored since SELinux is just closing
the leak and reporting the error. The application does not use the descriptor,
so it will run properly. If this is a redirection, you will not get output in
the /tmp/puppet.5428.0. You should generate a bugzilla on selinux-policy, and it
will get routed to the appropriate package. You can safely ignore this avc.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385)

Additional Information:

Source Context                unconfined_u:system_r:mount_t:s0
Target Context                unconfined_u:object_r:initrc_tmp_t:s0
Target Objects                /tmp/puppet.5428.0 [ file ]
Source                        mount
Source Path                   /bin/mount
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           util-linux-ng-2.16-10.3.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.32-55.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   leaks
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31.6-162.fc12.x86_64 #1
                              SMP Fri Dec 4 00:06:26 EST 2009 x86_64 x86_64
Alert Count                   924
First Seen                    Tue 08 Dec 2009 12:24:13 AM EST
Last Seen                     Wed 09 Dec 2009 02:59:00 PM EST
Local ID                      45c236ff-4e12-4b25-a08e-044bec748811
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1260388740.368:73361): avc:  denied  { write } for  pid=2187 comm="mount" path="/tmp/puppet.5428.0" dev=dm-2 ino=97691 scontext=unconfined_u:system_r:mount_t:s0 tcontext=unconfined_u:object_r:initrc_tmp_t:s0 tclass=file

node=(removed) type=AVC msg=audit(1260388740.368:73361): avc:  denied  { write } for  pid=2187 comm="mount" path="/tmp/puppet.5428.0" dev=dm-2 ino=97691 scontext=unconfined_u:system_r:mount_t:s0 tcontext=unconfined_u:object_r:initrc_tmp_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1260388740.368:73361): arch=c000003e syscall=59 success=yes exit=0 a0=7fffd8429d90 a1=7fffd8429db0 a2=4ab1ed0 a3=7fffd8429b00 items=0 ppid=5428 pid=2187 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="mount" exe="/bin/mount" subj=unconfined_u:system_r:mount_t:s0 key=(null)



Hash String generated from  selinux-policy-3.6.32-55.fc12,leaks,mount,mount_t,initrc_tmp_t,file,write
audit2allow suggests:

#============= mount_t ==============
allow mount_t initrc_tmp_t:file write;

Comment 1 Ricky Zhou 2009-12-11 07:43:14 UTC
Some clarification on this denial:

From what I understand, puppet writes the output of commands it runs to a
temporary file then reads the file in order to work around some sort of ruby
bug.  Here, puppet attempted to do this with the mount command and got denied.  

If it's useful, the execute method of
http://projects.reductivelabs.com/projects/puppet/repository/revisions/master/entry/lib/puppet/util.rb
is the code that seems to be leading to this denial.

Also, here is the related puppet bug about this issue: http://projects.reductivelabs.com/issues/2731

Comment 2 Daniel Walsh 2009-12-11 20:59:48 UTC
Puppet a system service should not be redirecting all confined applications to write to tmp files.  If it did this with append access to a log file in /var/log it would be allowed.

Comment 3 Bug Zapper 2010-11-04 03:38:39 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  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 '12'.

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 12'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 12 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

Comment 4 Bug Zapper 2010-12-04 01:49:20 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.