Bug 828325

Summary: SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the directory /usr/lib/python2.7.
Product: [Fedora] Fedora Reporter: KarlaLuna <orkut32>
Component: hplipAssignee: Tim Waugh <twaugh>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, jpopelka, mgrepl, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:8f17ec8e3d0e6861d398e00123945a01928e23daf22b6cc5fcaa13e3b9d5a39b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-13 23:54:28 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 KarlaLuna 2012-06-04 15:12:28 UTC
libreport version: 2.0.8
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.5-2.fc16.i686.PAE
reason:         SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the directory /usr/lib/python2.7.
time:           Seg 04 Jun 2012 12:12:03 BRT

description:
:SELinux is preventing /usr/bin/python2.7 from 'write' accesses on the directory /usr/lib/python2.7.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that python2.7 should be allowed write access on the python2.7 directory 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 hpfax /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:hplip_t:s0-s0:c0.c1023
:Target Context                system_u:object_r:lib_t:s0
:Target Objects                /usr/lib/python2.7 [ dir ]
:Source                        hpfax
:Source Path                   /usr/bin/python2.7
:Port                          <Desconhecido>
:Host                          (removed)
:Source RPM Packages           python-2.7.3-1.fc16.i686 python-2.7.3-3.fc16.i686
:Target RPM Packages           python-libs-2.7.3-1.fc16.i686 python-
:                              libs-2.7.3-3.fc16.i686
:Policy RPM                    selinux-policy-3.10.0-86.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.5-2.fc16.i686.PAE
:                              #1 SMP Tue May 8 11:43:02 UTC 2012 i686 i686
:Alert Count                   25
:First Seen                    Seg 04 Jun 2012 12:10:55 BRT
:Last Seen                     Seg 04 Jun 2012 12:10:56 BRT
:Local ID                      d5fd29d1-eee8-4f18-a742-96725d12c34e
:
:Raw Audit Messages
:type=AVC msg=audit(1338822656.509:107): avc:  denied  { write } for  pid=2514 comm="hpfax" name="python2.7" dev="dm-1" ino=139136 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=dir
:
:
:type=SYSCALL msg=audit(1338822656.509:107): arch=i386 syscall=unlink success=no exit=EACCES a0=bf90b32b a1=0 a2=b779d590 a3=98b0920 items=0 ppid=2509 pid=2514 auid=4294967295 uid=0 gid=7 euid=0 suid=0 fsuid=0 egid=7 sgid=7 fsgid=7 tty=(none) ses=4294967295 comm=hpfax exe=/usr/bin/python2.7 subj=system_u:system_r:hplip_t:s0-s0:c0.c1023 key=(null)
:
:Hash: hpfax,hplip_t,lib_t,dir,write
:
:audit2allow
:
:#============= hplip_t ==============
:#!!!! The source type 'hplip_t' can write to a 'dir' of the following types:
:# hplip_var_lib_t, hplip_var_run_t, print_spool_t, tmp_t, cupsd_tmp_t, var_run_t, hplip_tmp_t, root_t
:
:allow hplip_t lib_t:dir write;
:
:audit2allow -R
:
:#============= hplip_t ==============
:#!!!! The source type 'hplip_t' can write to a 'dir' of the following types:
:# hplip_var_lib_t, hplip_var_run_t, print_spool_t, tmp_t, cupsd_tmp_t, var_run_t, hplip_tmp_t, root_t
:
:allow hplip_t lib_t:dir write;
:

Comment 1 Daniel Walsh 2012-06-04 15:22:22 UTC
This looks like hpfax is trying to write out an optimized python file under /usr/lib/python2.7

Could you run hpfax as root and see if it creates content in /var/lib/python2.7.

Comment 2 Tim Waugh 2012-06-22 11:57:21 UTC
I see this too in audit.log but I can't seem to get it to happen on demand.

Interesting to note that the syscall is "unlink".  It's not trying to write a new file but remove a directory entry.

Comment 3 Daniel Walsh 2012-06-26 10:50:11 UTC
Yeah your right, Does cups have any content in this directory?

Comment 4 Daniel Walsh 2012-06-26 10:51:02 UTC
You might want to turn on full auditing to make sure this is happening where you think and put the machine into permissive mode to see if it actually removes a file/directory.

Comment 5 Tim Waugh 2012-06-26 11:28:40 UTC
I haven't been able to get this to happen on demand even once. The last time it happened was over a week ago.

Comment 6 Fedora End Of Life 2013-01-16 20:30:30 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Fedora End Of Life 2013-02-13 23:54:40 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.