Bug 1043263

Summary: SELinux is preventing /usr/sbin/php-fpm from 'getattr' accesses on the directory /home/mikhail.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:a66d26b85b214692111d20beba27f85ab565c2e7966fd08386b073a38efe6666
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-16 10:08:49 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 Mikhail 2013-12-15 14:11:18 UTC
Description of problem:
SELinux is preventing /usr/sbin/php-fpm from 'getattr' accesses on the directory /home/mikhail.

*****  Plugin catchall_boolean (47.5 confidence) suggests   ******************

If you want to allow httpd to read user content
Then you must tell SELinux about this by enabling the 'httpd_read_user_content' boolean.
You can read 'None' man page for more details.
Do
setsebool -P httpd_read_user_content 1

*****  Plugin catchall_boolean (47.5 confidence) suggests   ******************

If you want to allow httpd to enable homedirs
Then you must tell SELinux about this by enabling the 'httpd_enable_homedirs' boolean.
You can read 'None' man page for more details.
Do
setsebool -P httpd_enable_homedirs 1

*****  Plugin catchall (6.38 confidence) suggests   **************************

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

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                unconfined_u:object_r:user_home_dir_t:s0
Target Objects                /home/mikhail [ dir ]
Source                        php-fpm
Source Path                   /usr/sbin/php-fpm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           php-fpm-5.5.7-1.fc20.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-106.fc20.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.11.10-301.fc20.x86_64 #1 SMP Thu
                              Dec 5 14:01:17 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-12-15 20:10:46 YEKT
Last Seen                     2013-12-15 20:10:46 YEKT
Local ID                      552674d5-1de2-48a2-b080-cf68ed81855f

Raw Audit Messages
type=AVC msg=audit(1387116646.667:925): avc:  denied  { getattr } for  pid=16584 comm="php-fpm" path="/home/mikhail" dev="sdb" ino=168951809 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_home_dir_t:s0 tclass=dir


type=SYSCALL msg=audit(1387116646.667:925): arch=x86_64 syscall=lstat success=yes exit=0 a0=7fffd752d0c0 a1=7fffd752cb30 a2=7fffd752cb30 a3=1f items=0 ppid=16583 pid=16584 auid=4294967295 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=4294967295 tty=(none) comm=php-fpm exe=/usr/sbin/php-fpm subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: php-fpm,httpd_t,user_home_dir_t,dir,getattr

Additional info:
reporter:       libreport-2.1.10
hashmarkername: setroubleshoot
kernel:         3.11.10-301.fc20.x86_64
type:           libreport

Potential duplicate: bug 882347

Comment 1 Miroslav Grepl 2013-12-16 10:08:49 UTC
The aler tells you what to do.

$ man httpd_selinux

Explains this also.