Bug 748526 - SELinux is preventing /usr/bin/python from 'read' accesses on the lnk_file /etc/sysconfig/selinux.
Summary: SELinux is preventing /usr/bin/python from 'read' accesses on the lnk_file /e...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 16
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:4471dce4ea54be1d988f1fb7010...
: 756622 (view as bug list)
Depends On:
Blocks: 756622
TreeView+ depends on / blocked
 
Reported: 2011-10-24 17:17 UTC by Jimmy Collins
Modified: 2011-11-29 15:25 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.10.0-51.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-05 01:33:21 UTC
Type: ---


Attachments (Terms of Use)

Description Jimmy Collins 2011-10-24 17:17:01 UTC
libreport version: 2.0.6
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.1.0-0.rc10.git0.1.fc16.i686
reason:         SELinux is preventing /usr/bin/python from 'read' accesses on the lnk_file /etc/sysconfig/selinux.
time:           Mon Oct 24 13:16:49 2011

description:
:SELinux is preventing /usr/bin/python from 'read' accesses on the lnk_file /etc/sysconfig/selinux.
:
:*****  Plugin restorecon (99.5 confidence) suggests  *************************
:
:If you want to fix the label. 
:/etc/sysconfig/selinux default label should be etc_t.
:Then you can run restorecon.
:Do
:# /sbin/restorecon -v /etc/sysconfig/selinux
:
:*****  Plugin catchall (1.49 confidence) suggests  ***************************
:
:If you believe that python should be allowed read access on the selinux lnk_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 system-config-f /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:firewallgui_t:s0-s0:c0.c1023
:Target Context                system_u:object_r:selinux_config_t:s0
:Target Objects                /etc/sysconfig/selinux [ lnk_file ]
:Source                        system-config-f
:Source Path                   /usr/bin/python
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           python-2.7.2-4.fc16
:Target RPM Packages           selinux-policy-3.10.0-46.fc16
:Policy RPM                    selinux-policy-3.10.0-46.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed)
:                              3.1.0-0.rc10.git0.1.fc16.i686 #1 SMP Wed Oct 19
:                              05:19:44 UTC 2011 i686 i686
:Alert Count                   1
:First Seen                    Mon 24 Oct 2011 01:07:20 PM EDT
:Last Seen                     Mon 24 Oct 2011 01:07:20 PM EDT
:Local ID                      14845dfa-1220-4921-93e7-40759ec127a3
:
:Raw Audit Messages
:type=AVC msg=audit(1319476040.682:288): avc:  denied  { read } for  pid=19358 comm="system-config-f" name="selinux" dev=sda5 ino=40969 scontext=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 tcontext=system_u:object_r:selinux_config_t:s0 tclass=lnk_file
:
:
:type=SYSCALL msg=audit(1319476040.682:288): arch=i386 syscall=stat64 success=no exit=EACCES a0=83eeb10 a1=bfce704c a2=4a3beff4 a3=83eeb10 items=0 ppid=1 pid=19358 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=system-config-f exe=/usr/bin/python subj=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 key=(null)
:
:Hash: system-config-f,firewallgui_t,selinux_config_t,lnk_file,read
:
:audit2allow
:
:#============= firewallgui_t ==============
:allow firewallgui_t selinux_config_t:lnk_file read;
:
:audit2allow -R
:
:#============= firewallgui_t ==============
:allow firewallgui_t selinux_config_t:lnk_file read;
:

Comment 1 Daniel Walsh 2011-10-24 17:39:59 UTC
Fixed in selinux-policy-3.10.0-48.fc16

Comment 2 Fedora Update System 2011-10-27 17:04:47 UTC
selinux-policy-3.10.0-51.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-51.fc16

Comment 3 Fedora Update System 2011-10-28 21:31:23 UTC
Package selinux-policy-3.10.0-51.fc16:
* should fix your issue,
* was pushed to the Fedora 16 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.10.0-51.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15029
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2011-11-05 01:33:21 UTC
selinux-policy-3.10.0-51.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Stefan Schulze Frielinghaus 2011-11-12 11:40:55 UTC
I still get those AVC errors.

While trying to install a new network printer, a dialog came up which suggested to adjust the firewal. Afterwards, the AVC error is shown.

Policy Version: selinux-policy-3.10.0-55.fc16


SELinux is preventing /usr/bin/python from read access on the lnk_file /etc/sysconfig/selinux.

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

If you want to fix the label. 
/etc/sysconfig/selinux default label should be etc_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/sysconfig/selinux

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

If you believe that python should be allowed read access on the selinux lnk_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 system-config-f /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:firewallgui_t:s0-s0:c0.c1023
Target Context                system_u:object_r:selinux_config_t:s0
Target Objects                /etc/sysconfig/selinux [ lnk_file ]
Source                        system-config-f
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.2-5.2.fc16
Target RPM Packages           selinux-policy-3.10.0-55.fc16
Policy RPM                    selinux-policy-3.10.0-55.fc16
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux vogon.seekline.net 3.1.0-7.fc16.x86_64 #1
                              SMP Tue Nov 1 21:10:48 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Sat 12 Nov 2011 12:33:18 CET
Last Seen                     Sat 12 Nov 2011 12:33:18 CET
Local ID                      34fc6e2d-6334-4fdf-ab01-b7b9e2da6329

Raw Audit Messages
type=AVC msg=audit(1321097598.604:124): avc:  denied  { read } for  pid=3899 comm="system-config-f" name="selinux" dev=sda3 ino=49710 scontext=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 tcontext=system_u:object_r:selinux_config_t:s0 tclass=lnk_file


type=SYSCALL msg=audit(1321097598.604:124): arch=x86_64 syscall=stat success=no exit=EACCES a0=15aaf30 a1=7fffb6ed4d70 a2=7fffb6ed4d70 a3=308753f7f0 items=0 ppid=1 pid=3899 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=system-config-f exe=/usr/bin/python subj=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 key=(null)

Hash: system-config-f,firewallgui_t,selinux_config_t,lnk_file,read

audit2allow

#============= firewallgui_t ==============
allow firewallgui_t selinux_config_t:lnk_file read;

audit2allow -R

#============= firewallgui_t ==============
allow firewallgui_t selinux_config_t:lnk_file read;

Comment 6 Miroslav Grepl 2011-11-14 12:42:19 UTC
Execute

# restorecon -vF /etc/sysconfig/selinux

should fix.

Comment 7 Stefan Schulze Frielinghaus 2011-11-14 17:06:25 UTC
Ups, you are right. I was to quick. Thanks for the hint!

Comment 8 Miroslav Grepl 2011-11-24 09:42:25 UTC
*** Bug 756622 has been marked as a duplicate of this bug. ***

Comment 9 Miroslav Grepl 2011-11-28 11:26:57 UTC
*** Bug 757370 has been marked as a duplicate of this bug. ***

Comment 10 Daniel Walsh 2011-11-29 02:48:59 UTC
The question is how is this getting mislabeled?

Comment 11 Miroslav Grepl 2011-11-29 08:47:28 UTC
Yes, I asked in another bug if this happens on a fresh install.


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