Bug 886215

Summary: SELinux is preventing /usr/libexec/kde4/kcmdatetimehelper from 'unlink' accesses on the file /etc/localtime.
Product: [Fedora] Fedora Reporter: Julio Arias <juliooao>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:3b96d0af51a55c70913dcb5fc276c700c50da5f0d848c4349c7c698826fd709d
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-11 19:32:10 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:
Attachments:
Description Flags
File: type
none
File: hashmarkername none

Description Julio Arias 2012-12-11 19:22:14 UTC
Additional info:
libreport version: 2.0.18
kernel:         3.6.9-2.fc17.x86_64

description:
:SELinux is preventing /usr/libexec/kde4/kcmdatetimehelper from 'unlink' accesses on the file /etc/localtime.
:
:*****  Plugin restorecon (94.8 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_labels (5.21 confidence) suggests  ********************
:
:If you want to allow kcmdatetimehelper to have unlink access on the localtime file
:Then you need to change the label on /etc/localtime
:Do
:# semanage fcontext -a -t FILE_TYPE '/etc/localtime'
:where FILE_TYPE is one of the following: locale_t, config_usr_t, root_t. 
:Then execute: 
:restorecon -v '/etc/localtime'
:
:
:*****  Plugin catchall (1.44 confidence) suggests  ***************************
:
:If you believe that kcmdatetimehelper should be allowed unlink 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 kcmdatetimehelp /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:gnomeclock_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:etc_t:s0
:Target Objects                /etc/localtime [ file ]
:Source                        kcmdatetimehelp
:Source Path                   /usr/libexec/kde4/kcmdatetimehelper
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           kde-workspace-4.9.3-2.fc17.x86_64
:Target RPM Packages           glibc-2.15-58.fc17.x86_64 glibc-2.15-58.fc17.i686
:Policy RPM                    selinux-policy-3.10.0-161.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.9-2.fc17.x86_64 #1 SMP Tue Dec
:                              4 13:26:04 UTC 2012 x86_64 x86_64
:Alert Count                   3
:First Seen                    2012-12-11 13:19:54 CST
:Last Seen                     2012-12-11 13:20:52 CST
:Local ID                      6d81f4a2-3ac9-48c7-8e97-a56d19e9fbfc
:
:Raw Audit Messages
:type=AVC msg=audit(1355253652.388:69): avc:  denied  { unlink } for  pid=1720 comm="kcmdatetimehelp" name="localtime" dev="sda3" ino=20795 scontext=system_u:system_r:gnomeclock_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1355253652.388:69): arch=x86_64 syscall=unlink success=no exit=EACCES a0=82bb68 a1=7fff73b42660 a2=82bb50 a3=2 items=0 ppid=1 pid=1720 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=kcmdatetimehelp exe=/usr/libexec/kde4/kcmdatetimehelper subj=system_u:system_r:gnomeclock_t:s0-s0:c0.c1023 key=(null)
:
:Hash: kcmdatetimehelp,gnomeclock_t,etc_t,file,unlink
:
:audit2allow
:
:#============= gnomeclock_t ==============
:allow gnomeclock_t etc_t:file unlink;
:
:audit2allow -R
:
:#============= gnomeclock_t ==============
:allow gnomeclock_t etc_t:file unlink;
:


Potential duplicate bug: 844351

Comment 1 Julio Arias 2012-12-11 19:22:16 UTC
Created attachment 661620 [details]
File: type

Comment 2 Julio Arias 2012-12-11 19:22:18 UTC
Created attachment 661621 [details]
File: hashmarkername

Comment 3 Daniel Walsh 2012-12-11 19:32:10 UTC
Run the restorecon command mentioned in the alert.

I think this is fully fixed in F18.  I am not sure how the file gets mislabeled.

restorecon /etc/localtime

Comment 4 Miroslav Grepl 2012-12-12 08:39:06 UTC
Strange,
it should be also in F17.

Just execute the restorecon command how Dan suggested and reopen if you see it again. Thank you.