Bug 672980 - SELinux is preventing /usr/bin/python from 'open' accesses on the chr_file 022.
Summary: SELinux is preventing /usr/bin/python from 'open' accesses on the chr_file 022.
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 14
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:0afa61d232a...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-26 21:15 UTC by andy york
Modified: 2011-03-11 14:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-11 14:48:02 UTC
Type: ---


Attachments (Terms of Use)

Description andy york 2011-01-26 21:15:26 UTC
SELinux is preventing /usr/bin/python from 'open' accesses on the chr_file 022.

*****  Plugin device (91.4 confidence) suggests  *****************************

If you want to allow python to have open access on the 022 chr_file
Then you need to change the label on 022 to a type of a similar device.
Do
# semanage fcontext -a -t SIMILAR_TYPE '022'
# restorecon -v '022'

*****  Plugin catchall (9.59 confidence) suggests  ***************************

If you believe that python should be allowed open access on the 022 chr_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 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:device_t:s0
Target Objects                022 [ chr_file ]
Source                        hpfax
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7-8.fc14.1
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-25.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.10-74.fc14.x86_64 #1
                              SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   1
First Seen                    Wed 26 Jan 2011 01:29:15 PM EST
Last Seen                     Wed 26 Jan 2011 01:29:15 PM EST
Local ID                      86cf98d8-6e70-4e0d-b230-c1723f3ab8f1

Raw Audit Messages
type=AVC msg=audit(1296066555.823:38325): avc:  denied  { open } for  pid=23722 comm="hpfax" name="022" dev=devtmpfs ino=67868 scontext=system_u:system_r:hplip_t:s0-s0:c0.c1023 tcontext=system_u:object_r:device_t:s0 tclass=chr_file

hpfax,hplip_t,device_t,chr_file,open
type=SYSCALL msg=audit(1296066555.823:38325): arch=x86_64 syscall=open success=no exit=EACCES a0=7fffb7c024d0 a1=0 a2=d a3=ff items=0 ppid=23717 pid=23722 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/python subj=system_u:system_r:hplip_t:s0-s0:c0.c1023 key=(null)
hpfax,hplip_t,device_t,chr_file,open

#============= hplip_t ==============
allow hplip_t device_t:chr_file open;

Comment 1 Daniel Walsh 2011-01-26 21:32:00 UTC
the 022 device under /dev is mislabled

find /dev -name 022

Then run restorecon on the device.

Not sure how the device got created or why it is mislabeled.


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