Bug 853548 - SELinux is preventing /usr/bin/systemd-tmpfiles from getattr access on the file /var/tmp/kdecache-root/icon-cache.kcache.
Summary: SELinux is preventing /usr/bin/systemd-tmpfiles from getattr access on the fi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-31 20:08 UTC by Jeffrey
Modified: 2012-09-03 08:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-03 08:22:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jeffrey 2012-08-31 20:08:55 UTC
Description of problem: SELinux violation.


Version-Release number of selected component (if applicable):


How reproducible: Occurs at boot and constantly during the day.


Steps to Reproduce:
1. Boot computer.
  
Actual results: SELinux violation.


Expected results: No SELinux violation.


Additional info:

SELinux is preventing /usr/bin/systemd-tmpfiles from getattr access on the file /var/tmp/kdecache-root/icon-cache.kcache.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow systemd-tmpfiles to have getattr access on the icon-cache.kcache file
Then you need to change the label on /var/tmp/kdecache-root/icon-cache.kcache
Do
# semanage fcontext -a -t FILE_TYPE '/var/tmp/kdecache-root/icon-cache.kcache'
where FILE_TYPE is one of the following: sysctl_crypto_t, passwd_file_t, locale_t, var_auth_t, krb5_conf_t, etc_t, file_t, proc_t, sysfs_t, man_t, config_home_t, tmp_t, wtmp_t, cpu_online_t, systemd_tmpfiles_exec_t, non_security_file_type, lockfile, pidfile, tmpfile, samba_var_t, abrt_t, samba_etc_t, ld_so_t, lib_t, net_conf_t, sandbox_file_t, cpu_online_t, abrt_helper_exec_t, security_t, rpm_var_cache_t, faillog_t, systemd_tmpfiles_t, httpd_cache_t, proc_net_t, textrel_shlib_t, etc_runtime_t, user_home_type, rpm_script_tmp_t, rpm_var_lib_t, file_type, httpd_sys_rw_content_t, ld_so_cache_t, file_context_t, abrt_var_cache_t, etc_t, cert_t, sosreport_tmp_t, machineid_t, rpm_tmp_t, admin_home_t, sssd_public_t, abrt_var_run_t, selinux_config_t, krb5_host_rcache_t. 
Then execute: 
restorecon -v '/var/tmp/kdecache-root/icon-cache.kcache'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that systemd-tmpfiles should be allowed getattr access on the icon-cache.kcache 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 systemd-tmpfile /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_tmpfiles_t:s0
Target Context                unconfined_u:object_r:unlabeled_t:s0
Target Objects                /var/tmp/kdecache-root/icon-cache.kcache [ file ]
Source                        systemd-tmpfile
Source Path                   /usr/bin/systemd-tmpfiles
Port                          <Unknown>
Host                          JeffLinux
Source RPM Packages           systemd-44-17.fc17.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-146.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     JeffLinux
Platform                      Linux JeffLinux 3.5.2-3.fc17.x86_64 #1 SMP Tue Aug
                              21 19:06:52 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    2012-08-31 15:13:28 EDT
Last Seen                     2012-08-31 15:13:28 EDT
Local ID                      ff75ebf3-f72e-4323-89c8-b49ebabfa64f

Raw Audit Messages
type=AVC msg=audit(1346440408.988:77): avc:  denied  { getattr } for  pid=1787 comm="systemd-tmpfile" path="/var/tmp/kdecache-root/icon-cache.kcache" dev="dm-1" ino=262472 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=unconfined_u:object_r:unlabeled_t:s0 tclass=file


type=SYSCALL msg=audit(1346440408.988:77): arch=x86_64 syscall=newfstatat success=no exit=EACCES a0=5 a1=1e38243 a2=7fff46e7bb40 a3=100 items=0 ppid=1 pid=1787 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-tmpfile exe=/usr/bin/systemd-tmpfiles subj=system_u:system_r:systemd_tmpfiles_t:s0 key=(null)

Hash: systemd-tmpfile,systemd_tmpfiles_t,unlabeled_t,file,getattr

audit2allow

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t unlabeled_t:file getattr;

audit2allow -R

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t unlabeled_t:file getattr;

Comment 1 Miroslav Grepl 2012-09-03 08:22:52 UTC
Please remove

/var/tmp/kdecache-root

then it works. We added fixes to prevent this.


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