Bug 708809 - SELinux is preventing /usr/bin/python from 'getattr' accesses on the file /etc/localtime.
Summary: SELinux is preventing /usr/bin/python from 'getattr' accesses on the file /et...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:06d85e70b07...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-29 17:36 UTC by Phillip Lahman
Modified: 2011-10-07 14:20 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-07 14:20:08 UTC
Type: ---


Attachments (Terms of Use)

Description Phillip Lahman 2011-05-29 17:36:03 UTC
SELinux is preventing /usr/bin/python from 'getattr' accesses on the file /etc/localtime.

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

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

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

If you believe that python should be allowed getattr access on the localtime 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:etc_runtime_t:s0
Target Objects                /etc/localtime [ file ]
Source                        system-config-f
Source Path                   /usr/bin/python
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           python-2.7.1-7.fc15
Target RPM Packages           glibc-2.13.90-9
Policy RPM                    selinux-policy-3.9.16-24.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.6-27.fc15.x86_64 #1
                              SMP Sun May 15 17:23:28 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Sun 29 May 2011 02:57:24 AM CDT
Last Seen                     Sun 29 May 2011 02:57:24 AM CDT
Local ID                      7ca4eedd-2731-4eaf-9f20-85f68db214d7

Raw Audit Messages
type=AVC msg=audit(1306655844.9:148): avc:  denied  { getattr } for  pid=3005 comm="system-config-f" path="/etc/localtime" dev=dm-0 ino=5363 scontext=system_u:system_r:firewallgui_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file


type=SYSCALL msg=audit(1306655844.9:148): arch=x86_64 syscall=fstat success=yes exit=0 a0=9 a1=7fff01ea94d0 a2=7fff01ea94d0 a3=0 items=0 ppid=3004 pid=3005 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,etc_runtime_t,file,getattr

audit2allow

#============= firewallgui_t ==============
allow firewallgui_t etc_runtime_t:file getattr;

audit2allow -R

#============= firewallgui_t ==============
allow firewallgui_t etc_runtime_t:file getattr;

Comment 1 Dominick Grift 2011-05-29 17:53:00 UTC
The fix is to restorecon -v /etc/localtime (the type for this file should be locale_t)

Can you please restore the context and see if you can reproduce this issue
I would like to determine what messed up this context in the first place.

Please let me know if you were able to reproduce this event.

Comment 2 Miroslav Grepl 2011-05-29 20:10:53 UTC
Do you use KDE?


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