Bug 682531

Summary: SELinux is preventing /sbin/setfiles from 'write' accesses on the file /home/thomas/bash/ff-check.stdout.
Product: [Fedora] Fedora Reporter: Thomas Meyer <thomas.mey>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:2f24a24e23f72c8e15d055e3d509daa5436eae67b6470864549acdb82891c877
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-07 22:14:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Thomas Meyer 2011-03-06 12:48:33 UTC
SELinux is preventing /sbin/setfiles from 'write' accesses on the file /home/thomas/bash/ff-check.stdout.

*****  Plugin catchall (50.5 confidence) suggests  ***************************

If you believe that setfiles should be allowed write access on the ff-check.stdout file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep setfiles /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

*****  Plugin leaks (50.5 confidence) suggests  ******************************

If you want to ignore setfiles trying to write access the ff-check.stdout file, because you believe it should not need this access.
Then you should report this as a bug.  
You can generate a local policy module to dontaudit this access.
Do
# grep /sbin/setfiles /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c102
                              3
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/thomas/bash/ff-check.stdout [ file ]
Source                        setfiles
Source Path                   /sbin/setfiles
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           policycoreutils-2.0.85-12.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.15-2.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38-rc7-00142-g212e349 #267 Sat Mar 5 21:22:31
                              CET 2011 i686 i686
Alert Count                   1
First Seen                    So 06 Mär 2011 12:54:37 CET
Last Seen                     So 06 Mär 2011 12:54:37 CET
Local ID                      e274332d-91e4-4dca-bccb-c282346858ed

Raw Audit Messages
type=AVC msg=audit(1299412477.32:531): avc:  denied  { write } for  pid=24114 comm="setfiles" path="/home/thomas/bash/ff-check.stdout" dev=dm-0 ino=11665423 scontext=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1299412477.32:531): arch=i386 syscall=execve success=yes exit=0 a0=b7b36780 a1=b742e558 a2=0 a3=0 items=0 ppid=20492 pid=24114 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty4 ses=8 comm=setfiles exe=/sbin/setfiles subj=unconfined_u:unconfined_r:setfiles_t:s0-s0:c0.c1023 key=(null)

Hash: setfiles,setfiles_t,user_home_t,file,write

audit2allow

#============= setfiles_t ==============
allow setfiles_t user_home_t:file write;

audit2allow -R

#============= setfiles_t ==============
allow setfiles_t user_home_t:file write;

Comment 1 Thomas Meyer 2011-03-06 12:53:59 UTC
I did this:
"sudo fixfiles check > ~/bash/ff-check.stdout 2> ~/bash/ff-check.stderr &"

so I basically wanted to start this program as a bash background job.

Comment 2 Daniel Walsh 2011-03-07 22:14:07 UTC
I really do not want to fix this.  The easiest thing you could do to allow it would be to put in a cat in the stream

sudo fixfiles check | cat > ~/bash/ff-check.stdout 2> ~/bash/ff-check.stderr &