Bug 872865

Summary: SELinux is preventing /usr/sbin/php-fpm from 'write' accesses on the directory /var/lib/php/session.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE 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: i686   
OS: Unspecified   
Whiteboard: abrt_hash:0b8040657ffc143bc7f6ffe9f7200ba3ed825451264b0e65fb18a7d18d530b73
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-05 08:35:52 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:
Attachments:
Description Flags
File: type
none
File: hashmarkername none

Description Mikhail 2012-11-03 20:44:50 UTC
Additional info:
libreport version: 2.0.18
kernel:         3.6.5-2.fc18.i686.PAE

description:
:SELinux is preventing /usr/sbin/php-fpm from 'write' accesses on the directory /var/lib/php/session.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that php-fpm should be allowed write access on the session 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:phpfpm_t:s0
:Target Context                system_u:object_r:httpd_var_run_t:s0
:Target Objects                /var/lib/php/session [ dir ]
:Source                        php-fpm
:Source Path                   /usr/sbin/php-fpm
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           php-fpm-5.4.8-1.fc18.i686
:Target RPM Packages           php-5.4.8-1.fc18.i686
:Policy RPM                    selinux-policy-3.11.1-46.fc18.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.5-2.fc18.i686.PAE #1 SMP Thu
:                              Nov 1 00:52:47 UTC 2012 i686 i686
:Alert Count                   1
:First Seen                    2012-11-04 01:30:43 YEKT
:Last Seen                     2012-11-04 01:30:43 YEKT
:Local ID                      1e5b2f6f-1ab8-45dd-9d28-9a098c326ab5
:
:Raw Audit Messages
:type=AVC msg=audit(1351971043.173:559): avc:  denied  { write } for  pid=2444 comm="php-fpm" name="session" dev="sda1" ino=801294 scontext=system_u:system_r:phpfpm_t:s0 tcontext=system_u:object_r:httpd_var_run_t:s0 tclass=dir
:
:
:type=AVC msg=audit(1351971043.173:559): avc:  denied  { add_name } for  pid=2444 comm="php-fpm" name="sess_sjcb5qhlcvii65g94k7o0hkfk4" scontext=system_u:system_r:phpfpm_t:s0 tcontext=system_u:object_r:httpd_var_run_t:s0 tclass=dir
:
:
:type=AVC msg=audit(1351971043.173:559): avc:  denied  { create } for  pid=2444 comm="php-fpm" name="sess_sjcb5qhlcvii65g94k7o0hkfk4" scontext=system_u:system_r:phpfpm_t:s0 tcontext=system_u:object_r:httpd_var_run_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1351971043.173:559): arch=i386 syscall=open success=yes exit=E2BIG a0=bfab14ac a1=42 a2=180 a3=19 items=0 ppid=2442 pid=2444 auid=4294967295 uid=991 gid=988 euid=991 suid=991 fsuid=991 egid=988 sgid=988 fsgid=988 tty=(none) ses=4294967295 comm=php-fpm exe=/usr/sbin/php-fpm subj=system_u:system_r:phpfpm_t:s0 key=(null)
:
:Hash: php-fpm,phpfpm_t,httpd_var_run_t,dir,write
:
:audit2allow
:
:#============= phpfpm_t ==============
:#!!!! The source type 'phpfpm_t' can write to a 'dir' of the following types:
:# phpfpm_log_t, var_run_t, phpfpm_var_run_t
:
:allow phpfpm_t httpd_var_run_t:dir { write add_name };
:allow phpfpm_t httpd_var_run_t:file create;
:
:audit2allow -R
:
:#============= phpfpm_t ==============
:#!!!! The source type 'phpfpm_t' can write to a 'dir' of the following types:
:# phpfpm_log_t, var_run_t, phpfpm_var_run_t
:
:allow phpfpm_t httpd_var_run_t:dir { write add_name };
:allow phpfpm_t httpd_var_run_t:file create;
:

Comment 1 Mikhail 2012-11-03 20:44:53 UTC
Created attachment 637668 [details]
File: type

Comment 2 Mikhail 2012-11-03 20:44:55 UTC
Created attachment 637669 [details]
File: hashmarkername

Comment 3 Miroslav Grepl 2012-11-05 08:35:52 UTC

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