Bug 1770279
Summary: | SELinux is preventing firewalld from 'read' accesses on the directory site-packages. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Francesco Nicoletta <francesconico86> |
Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 31 | CC: | dwalsh, lvrabec, mario.claer, mgrepl, okrh, plautrba, zpytela |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | abrt_hash:bf254c1b20c055d256064da0d5ed2963880e9fe4a9afb0cf610aad37693defb6;VARIANT_ID=workstation; | ||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-04-20 16:02:35 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
Francesco Nicoletta
2019-11-08 15:35:59 UTC
Hi Francesco, From this report we can only see the directory name: site-packages. Do you happen to know its full path? Based on the result, we can better assess if or how this can be fixed. I just got the same error. It's a python directory. $ python -c "import site; print(site.getsitepackages())" ['/usr/local/lib64/python3.7/site-packages', '/usr/local/lib/python3.7/site-packages', '/usr/lib64/python3.7/site-packages', '/usr/lib/python3.7/site-packages'] I don't have a /usr/local/lib64 directory. For the other three, I did a restorecon -vR site-packages/, no output (but it did take some time, so apparently the contexts were OK). ls -Z produced a lot of system_u:object_r:lib_t:s0 for /usr/lib64/python3.7 and /usr/lib/python3.7 However, for /usr/local/lib/python3.7, I got unconfined_u:object_r:lib_t:s0 These were for babelfish and diskcache. I believe I recently installed those manually via pip. Next I did a sudo pip uninstall babelfish and sudo pip uninstall diskcache. Finally, sudo dnf install python3-babelfish. This installed babelfish into /usr/lib/python3.7/site-packages, and ls -Z produced system_u:object_r:lib_t:s0 I don't find a python3 diskcache package, and don't know if it's required by the app that needed babelfish. But I hope this solved this particular problem. The root of it seems to be Python packages manually installed via pip. additional info: the above info doesn't seem to pertain directly to firewalld When I followed the suggestion to generate a module, the .te file is: module my-firewalld 1.0; require { type gconf_home_t; type firewalld_t; class dir read; } #============= firewalld_t ============== allow firewalld_t gconf_home_t:dir read; ... so perhaps the site-packages was a red herring, or perhaps there is a deeper permissions problem. here is the raw AVC: type=AVC msg=audit(1580903533.768:35021): avc: denied { read } for pid=134160 comm="firewalld" name="site-packages" dev="sda13" ino=787078 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:gconf_home_t:s0 tclass=dir permissive=0 John, gconf_home_t type is assigned to files in .gconf, .gconfd and .local directories in users home. If files were downloaded first to one of those and then moved to other destination, the context needs to be restored to match the path. Can you locate the path of the directory from the last AVC? It has inode number 787078, filesystem is on device sda13. well, sda13 is /, so I did sudo find / -inum 787078 -print ... and let it run for a minute. The result: /root/.local/lib/python3.7/site-packages This no doubt came from using pip as a superuser. The directory is currently empty; I will delete it. John, If I understand correctly, your issue now can be considered as solved, so I am also closing this bz. Feel free to open a new bugzilla or to reopen this one and attach the needed information if the issue persists. |