Bug 873939

Summary: SELinux is preventing /usr/sbin/php-fpm from 'name_bind' accesses on the tcp_socket .
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl, mikhail.v.gavrilov
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:cff4d4eb6d5cac285eba3277046a14240d859b58ac54a60851d8fd887b32365f
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-07 04:30:26 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-07 03:09:54 UTC
Description of problem:
just restart php-fpm

Additional info:
libreport version: 2.0.18
kernel:         3.6.6-3.fc18.i686.PAE

description:
:SELinux is preventing /usr/sbin/php-fpm from 'name_bind' accesses on the tcp_socket .
:
:*****  Plugin bind_ports (99.5 confidence) suggests  *************************
:
:If you want to allow /usr/sbin/php-fpm to bind to network port 9000
:Then you need to modify the port type.
:Do
:# semanage port -a -t PORT_TYPE -p tcp 9000
:    where PORT_TYPE is one of the following: ntop_port_t, http_cache_port_t, http_port_t, puppet_port_t, jboss_messaging_port_t, jboss_management_port_t.
:
:*****  Plugin catchall (1.49 confidence) suggests  ***************************
:
:If you believe that php-fpm should be allowed name_bind access on the  tcp_socket 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                system_u:object_r:unreserved_port_t:s0
:Target Objects                 [ tcp_socket ]
:Source                        php-fpm
:Source Path                   /usr/sbin/php-fpm
:Port                          9000
:Host                          (removed)
:Source RPM Packages           php-fpm-5.4.8-4.fc18.i686
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.11.1-50.fc18.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.6.6-3.fc18.i686.PAE #1 SMP Mon
:                              Nov 5 16:37:58 UTC 2012 i686 i686
:Alert Count                   1
:First Seen                    2012-11-07 09:09:12 YEKT
:Last Seen                     2012-11-07 09:09:12 YEKT
:Local ID                      a364f3c4-e966-4e15-92aa-0ebd2f507b47
:
:Raw Audit Messages
:type=AVC msg=audit(1352257752.956:321): avc:  denied  { name_bind } for  pid=2008 comm="php-fpm" src=9000 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
:
:
:type=SYSCALL msg=audit(1352257752.956:321): arch=i386 syscall=socketcall success=no exit=EACCES a0=2 a1=bfa0f100 a2=83f0000 a3=9 items=0 ppid=1 pid=2008 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=php-fpm exe=/usr/sbin/php-fpm subj=system_u:system_r:httpd_t:s0 key=(null)
:
:Hash: php-fpm,httpd_t,unreserved_port_t,tcp_socket,name_bind
:
:audit2allow
:
:#============= httpd_t ==============
:#!!!! This avc can be allowed using the boolean 'nis_enabled'
:
:allow httpd_t unreserved_port_t:tcp_socket name_bind;
:
:audit2allow -R
:
:#============= httpd_t ==============
:#!!!! This avc can be allowed using the boolean 'nis_enabled'
:
:allow httpd_t unreserved_port_t:tcp_socket name_bind;
:

Comment 1 Mikhail 2012-11-07 03:09:59 UTC
Created attachment 639770 [details]
File: type

Comment 2 Mikhail 2012-11-07 03:10:02 UTC
Created attachment 639771 [details]
File: hashmarkername

Comment 3 Miroslav Grepl 2012-11-07 10:08:15 UTC
Fixed in selinux-policy-3.11.1-51.fc18

Comment 4 Fedora Update System 2012-11-28 20:57:08 UTC
selinux-policy-3.11.1-57.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-57.fc18

Comment 5 Fedora Update System 2012-11-30 06:35:21 UTC
Package selinux-policy-3.11.1-57.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-57.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-19374/selinux-policy-3.11.1-57.fc18
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-12-02 19:29:22 UTC
Package selinux-policy-3.11.1-59.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-59.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-19374/selinux-policy-3.11.1-59.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2012-12-06 20:11:42 UTC
Package selinux-policy-3.11.1-60.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-60.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-19374/selinux-policy-3.11.1-60.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-12-07 04:30:28 UTC
selinux-policy-3.11.1-60.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.