Bug 956754 - SELinux is preventing /usr/bin/python2.7 from 'execute' accesses on the file /usr/bin/hpijs.
Summary: SELinux is preventing /usr/bin/python2.7 from 'execute' accesses on the file ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:d6620e36a4f07d59e1008ab6f4c...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-25 14:33 UTC by Fahad Alduraibi
Modified: 2013-04-27 23:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-27 23:53:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Fahad Alduraibi 2013-04-25 14:33:20 UTC
Description of problem:
I pluged a new USB printer and got this SELinux error while it was being detected.
SELinux is preventing /usr/bin/python2.7 from 'execute' accesses on the file /usr/bin/hpijs.

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

If you believe that python2.7 should be allowed execute access on the hpijs 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 udev-add-printe /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:cupsd_config_t:s0
Target Context                system_u:object_r:cupsd_exec_t:s0
Target Objects                /usr/bin/hpijs [ file ]
Source                        udev-add-printe
Source Path                   /usr/bin/python2.7
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.3-13.fc18.i686
Target RPM Packages           hpijs-3.13.3-2.fc18.i686
Policy RPM                    selinux-policy-3.11.1-91.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) #1 SMP Wed Apr 17 23:36:49 UTC
                              2013 i686 i686
Alert Count                   1
First Seen                    2013-04-25 10:28:29 EDT
Last Seen                     2013-04-25 10:28:29 EDT
Local ID                      6cb3290b-b620-4190-9ec3-618b3013cae0

Raw Audit Messages
type=AVC msg=audit(1366900109.680:379): avc:  denied  { execute } for  pid=6469 comm="udev-add-printe" name="hpijs" dev="sda6" ino=6321470 scontext=system_u:system_r:cupsd_config_t:s0 tcontext=system_u:object_r:cupsd_exec_t:s0 tclass=file


type=SYSCALL msg=audit(1366900109.680:379): arch=i386 syscall=access success=no exit=EACCES a0=90c4140 a1=1 a2=41c46000 a3=8eb1050 items=0 ppid=1 pid=6469 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=udev-add-printe exe=/usr/bin/python2.7 subj=system_u:system_r:cupsd_config_t:s0 key=(null)

Hash: udev-add-printe,cupsd_config_t,cupsd_exec_t,file,execute

audit2allow

#============= cupsd_config_t ==============
allow cupsd_config_t cupsd_exec_t:file execute;

audit2allow -R
require {
	type cupsd_config_t;
	type cupsd_exec_t;
	class file execute;
}

#============= cupsd_config_t ==============
allow cupsd_config_t cupsd_exec_t:file execute;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.8-202.fc18.i686.PAE
type:           libreport

Comment 1 Daniel Walsh 2013-04-25 15:59:36 UTC
Could you run this in permissive mode and see if you get any more avcs?  

Did everything work properly?

This looks like udev-add-printer is doing an access check on it.

semanage permissive -a cupsd_config_t

Comment 2 Daniel Walsh 2013-04-25 16:08:09 UTC
Miroslav in F17 we had

domtrans_pattern(cupsd_config_t, hplip_exec_t, hplip_t)

So maybe we need.

domtrans_pattern(cupsd_config_t, cupsd_exec_t, cupsd_t)

Comment 3 Miroslav Grepl 2013-04-26 06:46:15 UTC
Yes, you are right.

commit 8b13b1944738e604dea620a5af5eddb00c6bd21b
Author: Miroslav Grepl <mgrepl>
Date:   Fri Apr 26 08:45:31 2013 +0200

    Add transition from cupsd_config_t to cupsd_t

Comment 4 Fedora Update System 2013-04-26 13:06:42 UTC
selinux-policy-3.11.1-92.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-92.fc18

Comment 5 Fedora Update System 2013-04-27 00:17:09 UTC
Package selinux-policy-3.11.1-92.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-92.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-6769/selinux-policy-3.11.1-92.fc18
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-04-27 23:53:57 UTC
selinux-policy-3.11.1-92.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.