Bug 693765

Summary: SELinux is preventing /usr/bin/python from 'create' accesses on the file state.log.
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dwalsh, mgrepl, vondruch
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:b2e62c2f5c34fed58710695fd02acd8e0f9f114da2173fde0c7f59348c69d7b0
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-05 15:04:53 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 Vít Ondruch 2011-04-05 14:34:33 UTC
SELinux is preventing /usr/bin/python from 'create' accesses on the file state.log.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that python should be allowed create access on the state.log 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 mock /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:mock_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                state.log [ file ]
Source                        mock
Source Path                   /usr/bin/python
Port                          <Neznámé>
Host                          (removed)
Source RPM Packages           python-2.7.1-6.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-10.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38.2-9.fc15.x86_64 #1 SMP Wed Mar 30 16:55:57
                              UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Út 5. duben 2011, 11:03:40 CEST
Last Seen                     Út 5. duben 2011, 11:03:40 CEST
Local ID                      5452c072-0842-4fe1-84b0-fce27da19dc3

Raw Audit Messages
type=AVC msg=audit(1301994220.287:407): avc:  denied  { create } for  pid=28084 comm="mock" name="state.log" scontext=unconfined_u:unconfined_r:mock_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1301994220.287:407): arch=x86_64 syscall=open success=yes exit=E2BIG a0=15d6cf0 a1=442 a2=1b6 a3=3d8bf3fdc0 items=0 ppid=28083 pid=28084 auid=500 uid=500 gid=500 euid=500 suid=0 fsuid=500 egid=500 sgid=500 fsgid=500 tty=pts0 ses=2 comm=mock exe=/usr/bin/python subj=unconfined_u:unconfined_r:mock_t:s0-s0:c0.c1023 key=(null)

Hash: mock,mock_t,user_home_t,file,create

audit2allow

#============= mock_t ==============
allow mock_t user_home_t:file create;

audit2allow -R

#============= mock_t ==============
allow mock_t user_home_t:file create;

Comment 1 Vít Ondruch 2011-04-05 14:37:34 UTC
This AVC appears every time I am doing "mock shell"

Comment 2 Vít Ondruch 2011-04-05 14:40:55 UTC
More specifically:

1. mock init
2. mock shell

Comment 3 Daniel Walsh 2011-04-05 15:04:53 UTC
We need to stop transitioning from unconfined_t to mock_t.

*** This bug has been marked as a duplicate of bug 693710 ***