Bug 860746 - SELinux is preventing /usr/sbin/php-fpm from 'write' accesses on the sock_file /var/lib/mysql/mysql.sock.
SELinux is preventing /usr/sbin/php-fpm from 'write' accesses on the sock_fil...
Status: CLOSED DUPLICATE of bug 861975
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
18
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:12c2add575c0ff9ac5aae142f78...
:
: 860724 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-26 11:41 EDT by Jonathan VK
Modified: 2012-11-05 03:37 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-05 03:37:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: type (9 bytes, text/plain)
2012-09-26 11:41 EDT, Jonathan VK
no flags Details
File: hashmarkername (14 bytes, text/plain)
2012-09-26 11:41 EDT, Jonathan VK
no flags Details

  None (edit)
Description Jonathan VK 2012-09-26 11:41:26 EDT
Additional info:
libreport version: 2.0.13
kernel:         3.6.0-0.rc6.git0.2.fc18.x86_64

description:
:SELinux is preventing /usr/sbin/php-fpm from 'write' accesses on the sock_file /var/lib/mysql/mysql.sock.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that php-fpm should be allowed write access on the mysql.sock sock_file 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:mysqld_var_run_t:s0
:Target Objects                /var/lib/mysql/mysql.sock [ sock_file ]
:Source                        php-fpm
:Source Path                   /usr/sbin/php-fpm
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           php-fpm-5.4.7-5.fc18.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.11.1-21.fc18.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.0-0.rc6.git0.2.fc18.x86_64 #1
:                              SMP Mon Sep 17 17:29:08 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    2012-09-26 11:30:02 EDT
:Last Seen                     2012-09-26 11:30:02 EDT
:Local ID                      73571307-d649-4feb-8b31-b1b52ebac118
:
:Raw Audit Messages
:type=AVC msg=audit(1348673402.335:1074): avc:  denied  { write } for  pid=22995 comm="php-fpm" name="mysql.sock" dev="sdb3" ino=1840001 scontext=system_u:system_r:phpfpm_t:s0 tcontext=system_u:object_r:mysqld_var_run_t:s0 tclass=sock_file
:
:
:type=AVC msg=audit(1348673402.335:1074): avc:  denied  { connectto } for  pid=22995 comm="php-fpm" path="/var/lib/mysql/mysql.sock" scontext=system_u:system_r:phpfpm_t:s0 tcontext=system_u:system_r:mysqld_t:s0 tclass=unix_stream_socket
:
:
:type=SYSCALL msg=audit(1348673402.335:1074): arch=x86_64 syscall=connect success=yes exit=0 a0=4 a1=7fff72793490 a2=6e a3=4000 items=0 ppid=22990 pid=22995 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 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,mysqld_var_run_t,sock_file,write
:
:audit2allow
:
:#============= phpfpm_t ==============
:allow phpfpm_t mysqld_t:unix_stream_socket connectto;
:allow phpfpm_t mysqld_var_run_t:sock_file write;
:
:audit2allow -R
:
:#============= phpfpm_t ==============
:allow phpfpm_t mysqld_t:unix_stream_socket connectto;
:allow phpfpm_t mysqld_var_run_t:sock_file write;
:
Comment 1 Jonathan VK 2012-09-26 11:41:32 EDT
Created attachment 617614 [details]
File: type
Comment 2 Jonathan VK 2012-09-26 11:41:34 EDT
Created attachment 617615 [details]
File: hashmarkername
Comment 3 Miroslav Grepl 2012-09-26 14:02:53 EDT
*** Bug 860724 has been marked as a duplicate of this bug. ***
Comment 4 Jonathan VK 2012-09-26 14:40:07 EDT
Bug 860724 happens when php-fpm tries to connect to a MySQL server through a tcp socket "mysql_connect('X.X.X.X:3306')", whereas this bug affects php-fpm when connecting to a unix socket. "mysql_connect(':/var/lib/mysql/mysql.sock')".

There are a few more of these policy issues with php-fpm that I'm running into as I set my development environment up. Would it be preferable if I compile them into a single bug report, and what should I include, or should I continue using the SELinux alert tool to submit them individually?
Comment 5 Daniel Walsh 2012-09-26 16:21:54 EDT
No bundle them together into this report is fine.
Comment 6 Miroslav Grepl 2012-11-05 03:37:55 EST

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

Note You need to log in before you can comment on or make changes to this bug.