Bug 1401513

Summary: SELinux is preventing /usr/bin/python3.5 from 'open' accesses on the file /usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg.
Product: [Fedora] Fedora Reporter: sheepdestroyer <sheepdestroyer>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba, pmoore, ssekidde
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:a7a943adf5c47befb275902081eb2cc4c99365efb6f03d25ad24948ae7969be3;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-05 13:38:23 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 sheepdestroyer 2016-12-05 13:33:27 UTC
Description of problem:
SELinux is preventing /usr/bin/python3.5 from 'open' accesses on the file /usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg default label should be lib_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that python3.5 should be allowed open access on the mkosi-1-py3.5.egg 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:
# ausearch -c 'firewalld' --raw | audit2allow -M my-firewalld
# semodule -X 300 -i my-firewalld.pp

Additional Information:
Source Context                system_u:system_r:firewalld_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg
                              [ file ]
Source                        firewalld
Source Path                   /usr/bin/python3.5
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python3-3.5.2-4.fc25.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-224.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.8.10-300.fc25.x86_64 #1 SMP Mon
                              Nov 21 18:59:16 UTC 2016 x86_64 x86_64
Alert Count                   19
First Seen                    2016-11-14 10:26:57 CET
Last Seen                     2016-12-05 09:39:47 CET
Local ID                      6aa9af9a-0c39-40eb-9e40-e6bd0f7fbbee

Raw Audit Messages
type=AVC msg=audit(1480927187.289:97): avc:  denied  { open } for  pid=853 comm="firewalld" path="/usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg" dev="sda6" ino=1497374 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0


type=SYSCALL msg=audit(1480927187.289:97): arch=x86_64 syscall=open success=no exit=EACCES a0=7f6e1fd856d8 a1=0 a2=1b6 a3=0 items=1 ppid=1 pid=853 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=firewalld exe=/usr/bin/python3.5 subj=system_u:system_r:firewalld_t:s0 key=(null)

type=CWD msg=audit(1480927187.289:97): cwd=/

type=PATH msg=audit(1480927187.289:97): item=0 name=/usr/lib/python3.5/site-packages/mkosi-1-py3.5.egg inode=1497374 dev=08:06 mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=unconfined_u:object_r:user_home_t:s0 nametype=NORMAL

Hash: firewalld,firewalld_t,user_home_t,file,open

Version-Release number of selected component:
selinux-policy-3.13.1-224.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.10-300.fc25.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2016-12-05 13:37:06 UTC
*** Bug 1401514 has been marked as a duplicate of this bug. ***

Comment 2 Lukas Vrabec 2016-12-05 13:38:23 UTC
Hi, 

/usr/lib/python3.5/site-packages/* is mislabeled on your system.
Please fix it using:

# /sbin/restorecon -Rv /usr/lib/python3.5/site-packages/

Thanks, 
Lukas.

Comment 3 sheepdestroyer 2016-12-09 01:01:13 UTC
Thank you