Bug 919014

Summary: SELinux is preventing /usr/bin/find from 'read' accesses on the directory /.
Product: [Fedora] Fedora Reporter: James Cape <jamescape777>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:23e14c81fade253e6c69ffc690010db6d9e22b5a2fe22703b351a5a61dcf35de
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-14 03:00:45 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:

Description James Cape 2013-03-07 12:07:27 UTC
Description of problem:
SELinux is preventing /usr/bin/find from 'read' accesses on the directory /.

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

If you want to allow find 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: rpm_var_lib_t, device_t, locale_t, sssd_public_t, etc_t, systemd_logind_var_run_t, systemd_passwd_var_run_t, abrt_t, base_ro_file_type, lib_t, man_t, prelink_log_t, root_t, usr_t, prelink_var_lib_t, device_t, etc_t, textrel_shlib_t, sysfs_t, cgroup_t, bin_t, init_t, lib_t, prelink_cron_system_t, var_lib_t, samba_etc_t, net_conf_t, var_run_t, sysctl_crypto_t, systemd_unit_file_type, rpm_var_cache_t, etc_t, proc_t, init_var_run_t, cert_t, var_lib_t, nscd_var_run_t, var_lib_t, net_conf_t, sysctl_kernel_t, cert_t. 
Then execute: 
restorecon -v '/'


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

If you believe that find 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 find /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:prelink_cron_system_t:s0-s0:c0.c
                              1023
Target Context                system_u:object_r:mnt_t:s0
Target Objects                / [ dir ]
Source                        find
Source Path                   /usr/bin/find
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           findutils-4.5.10-5.fc18.x86_64
Target RPM Packages           filesystem-3.1-2.fc18.x86_64
Policy RPM                    selinux-policy-3.11.1-82.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.8.1-201.fc18.x86_64 #1 SMP Thu
                              Feb 28 19:23:08 UTC 2013 x86_64 x86_64
Alert Count                   9
First Seen                    2013-03-05 03:30:07 EST
Last Seen                     2013-03-07 03:14:04 EST
Local ID                      fc39b8a7-d527-47e5-b469-53e9ae8f046f

Raw Audit Messages
type=AVC msg=audit(1362644044.569:1401): avc:  denied  { read } for  pid=27716 comm="find" name="/" dev="dm-1" ino=2 scontext=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 tcontext=system_u:object_r:mnt_t:s0 tclass=dir


type=SYSCALL msg=audit(1362644044.569:1401): arch=x86_64 syscall=open success=no exit=EACCES a0=425fa7 a1=0 a2=0 a3=10 items=0 ppid=27708 pid=27716 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=70 tty=(none) comm=find exe=/usr/bin/find subj=system_u:system_r:prelink_cron_system_t:s0-s0:c0.c1023 key=(null)

Hash: find,prelink_cron_system_t,mnt_t,dir,read

audit2allow

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

audit2allow -R

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


Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.1-201.fc18.x86_64
type:           libreport

Potential duplicate: bug 703437

Comment 1 Daniel Walsh 2013-03-07 14:46:32 UTC
02e6e5eb370020972b03a07ef2c58fe9373d191f fixes this in Rawhide.

Comment 2 Miroslav Grepl 2013-03-11 15:29:01 UTC
Back ported.

Comment 3 Fedora Update System 2013-03-12 13:55:37 UTC
selinux-policy-3.11.1-85.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2013-3605/selinux-policy-3.11.1-85.fc18

Comment 4 Fedora Update System 2013-03-12 23:35:35 UTC
Package selinux-policy-3.11.1-85.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-85.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3605/selinux-policy-3.11.1-85.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-03-14 03:00:47 UTC
selinux-policy-3.11.1-85.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.