Bug 710460

Summary: SELinux is preventing /sbin/setfiles from 'read' accesses on the directory /.
Product: [Fedora] Fedora Reporter: Clyde E. Kunkel <clydekunkel7734>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:f76d42de0994bad99a821a30d5af6d1617ccc18c441be98560cbaa44cd16f512
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-03 15:50:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Clyde E. Kunkel 2011-06-03 13:15:40 UTC
SELinux is preventing /sbin/setfiles from 'read' accesses on the directory /.

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

If you want to allow setfiles to have read access on the  directory
Then you need to change the label on /
Do
# semanage fcontext -a -t FILE_TYPE '/'
where FILE_TYPE is one of the following: devicekit_tmp_t, dbusd_etc_t, var_lib_t, var_run_t, domain, proc_net_t, var_log_t, sysctl_crypto_t, net_conf_t, inotifyfs_t, sysctl_kernel_t, abrt_t, hald_var_run_t, lib_t, devicekit_var_log_t, root_t, udev_var_run_t, usr_t, devicekit_power_t, device_t, etc_t, devicekit_var_lib_t, devicekit_var_run_t, textrel_shlib_t, bin_t, sysctl_fs_t, boot_t, sysctl_vm_t, cert_t, tmp_t, usr_t, device_t, locale_t, etc_t, proc_t, sysfs_t, config_home_t, var_run_t, nscd_var_run_t. 
Then execute: 
restorecon -v '/'


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

If you believe that setfiles should be allowed read access on the  directory 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 restorecon /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:devicekit_power_t:s0-s0:c0.c1023
Target Context                system_u:object_r:mnt_t:s0
Target Objects                / [ dir ]
Source                        restorecon
Source Path                   /sbin/setfiles
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           policycoreutils-2.0.86-9.fc16
Target RPM Packages           filesystem-2.4.42-1.fc16
Policy RPM                    selinux-policy-3.9.16-24.fc16
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.39-1.fc16.x86_64
                              #1 SMP Sat May 21 02:34:01 UTC 2011 x86_64 x86_64
Alert Count                   10
First Seen                    Sat 28 May 2011 09:52:26 AM EDT
Last Seen                     Fri 03 Jun 2011 08:41:02 AM EDT
Local ID                      9c16186e-7324-4559-9f81-3e61c7e334f8

Raw Audit Messages
type=AVC msg=audit(1307104862.673:71): avc:  denied  { read } for  pid=1959 comm="restorecon" name="/" dev=dm-0 ino=2 scontext=system_u:system_r:devicekit_power_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mnt_t:s0 tclass=dir


type=SYSCALL msg=audit(1307104862.673:71): arch=x86_64 syscall=open success=yes exit=EIO a0=7f5a4ca64cb3 a1=0 a2=0 a3=7fff6591f9f0 items=0 ppid=1947 pid=1959 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=restorecon exe=/sbin/setfiles subj=system_u:system_r:devicekit_power_t:s0-s0:c0.c1023 key=(null)

Hash: restorecon,devicekit_power_t,mnt_t,dir,read

audit2allow

#============= devicekit_power_t ==============
allow devicekit_power_t mnt_t:dir read;

audit2allow -R

#============= devicekit_power_t ==============
allow devicekit_power_t mnt_t:dir read;

Comment 1 Daniel Walsh 2011-06-03 15:50:47 UTC
I have no idea why devicekit_power_t to would running restorecon on /mnt, but I will add dontaudit.