Bug 671217

Summary: SELinux is preventing /bin/sed "create" access on sedbREW6n.
Product: [Fedora] Fedora Reporter: Walt <waltsaw>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 13CC: dwalsh, mgrepl, waltsaw
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:efab8c98e174f99018d2a7d3b0c0ebd84c95a355dd6d99976ba48e8b3d662db3
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-20 19:56:04 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 Walt 2011-01-20 19:06:36 UTC
Summary:

SELinux is preventing /bin/sed "create" access on sedbREW6n.

Detailed Description:

SELinux denied access requested by sed. It is not expected that this access is
required by sed 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.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                user_u:user_r:user_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                sedbREW6n [ file ]
Source                        sed
Source Path                   /bin/sed
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           sed-4.2.1-5.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-76.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux laptop2.sawyernet 2.6.34.7-66.fc13.i686 #1
                              SMP Wed Dec 15 07:40:25 UTC 2010 i686 i686
Alert Count                   4
First Seen                    Mon 03 Jan 2011 09:49:29 AM EST
Last Seen                     Sun 16 Jan 2011 09:26:52 PM EST
Local ID                      796f8fc5-7f9b-40a2-9d5b-b130a5beb145
Line Numbers                  

Raw Audit Messages            

node=laptop2.sawyernet type=AVC msg=audit(1295231212.163:105052): avc:  denied  { create } for  pid=4999 comm="sed" name="sedbREW6n" scontext=user_u:user_r:user_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file

node=laptop2.sawyernet type=SYSCALL msg=audit(1295231212.163:105052): arch=40000003 syscall=5 success=no exit=-13 a0=a037360 a1=80c2 a2=180 a3=3f70 items=0 ppid=4874 pid=4999 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="sed" exe="/bin/sed" subj=user_u:user_r:user_t:s0 key=(null)



Hash String generated from  catchall,sed,user_t,user_home_t,file,create
audit2allow suggests:

#============= user_t ==============
#!!!! This avc is a constraint violation.  You will need to add an attribute to either the source or target type to make it work.
#Contraint rule: 
allow user_t user_home_t:file create;

Comment 1 Daniel Walsh 2011-01-20 19:56:04 UTC
If you switch a user account to confined user, you need to 

chcon -u user_u -R ~/

Or run restorecon -R -v -F ~/

The problem here is you have a user_t user trying to modify files created by the unconfined_t user.

Comment 2 Daniel Walsh 2011-01-20 19:59:26 UTC
*** Bug 671220 has been marked as a duplicate of this bug. ***

Comment 3 Daniel Walsh 2011-01-20 19:59:42 UTC
*** Bug 671222 has been marked as a duplicate of this bug. ***