Bug 702066

Summary: SELinux is preventing /bin/ps from 'getattr' accesses on the directory /proc/<pid>.
Product: [Fedora] Fedora Reporter: Ankur Sinha (FranciscoD) <sanjay.ankur>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-05 05:44:21 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 Ankur Sinha (FranciscoD) 2011-05-04 16:56:33 UTC
SELinux is preventing /bin/ps from 'getattr' accesses on the directory /proc/<pid>.

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

If you want to allow ps to have getattr access on the <pid> directory
Then you need to change the label on /proc/<pid>
Do
# semanage fcontext -a -t FILE_TYPE '/proc/<pid>'
where FILE_TYPE is one of the following: sysctl_t, abrt_t, bin_t, lib_t, mnt_t, root_t, tmp_t, usr_t, var_t, device_t, etc_t, httpd_sys_content_t, proc_t, nscd_var_run_t, ksmtuned_t, textrel_shlib_t, rpm_script_tmp_t, var_t, security_t, bin_t, default_t, sosreport_tmp_t, usr_t, var_t, rpm_tmp_t, var_run_t, device_t, devpts_t, locale_t, etc_t, proc_t, sysfs_t, rpm_log_t, var_log_t, ksmtuned_log_t, var_lib_t, ksmtuned_var_run_t, abrt_var_run_t, var_run_t, domain, sysctl_crypto_t, setrans_var_run_t, var_log_t, cgroup_t, root_t, sysfs_t, tmpfs_t. 
Then execute: 
restorecon -v '/proc/<pid>'


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

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

Additional Information:
Source Context                system_u:system_r:ksmtuned_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /proc/<pid> [ dir ]
Source                        ps
Source Path                   /bin/ps
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           procps-3.2.8-18.20110302git.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-16.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.2-9.fc15.x86_64 #1 SMP Wed
                              Mar 30 16:55:57 UTC 2011 x86_64 x86_64
Alert Count                   238
First Seen                    Sun 24 Apr 2011 14:04:41 IST
Last Seen                     Sun 24 Apr 2011 17:59:47 IST
Local ID                      dcc554b6-4a8f-4afc-a832-80c90ce95f6a

Raw Audit Messages
type=AVC msg=audit(1303648187.811:400): avc:  denied  { getattr } for  pid=28569 comm="ps" path="/proc/24500" dev=proc ino=237599 scontext=system_u:system_r:ksmtuned_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir


type=SYSCALL msg=audit(1303648187.811:400): arch=x86_64 syscall=stat success=no exit=EACCES a0=944120 a1=3fbe80f120 a2=3fbe80f120 a3=0 items=0 ppid=28568 pid=28569 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ps exe=/bin/ps subj=system_u:system_r:ksmtuned_t:s0 key=(null)

Hash: ps,ksmtuned_t,unlabeled_t,dir,getattr

audit2allow

#============= ksmtuned_t ==============
allow ksmtuned_t unlabeled_t:dir getattr;

audit2allow -R

#============= ksmtuned_t ==============
allow ksmtuned_t unlabeled_t:dir getattr;

Comment 1 Miroslav Grepl 2011-05-05 05:44:21 UTC

*** This bug has been marked as a duplicate of bug 702071 ***