Bug 594075 - SELinux is preventing /usr/sbin/httpd from loading /usr/local/zend/lib/apache2/libphp5.so which requires text relocation.
Summary: SELinux is preventing /usr/sbin/httpd from loading /usr/local/zend/lib/apache...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 12
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:deb0c859dd4...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-20 13:48 UTC by Clement
Modified: 2010-06-04 18:58 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.6.32-116.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-04 18:58:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Clement 2010-05-20 13:48:49 UTC
Summary:

SELinux is preventing /usr/sbin/httpd from loading
/usr/local/zend/lib/apache2/libphp5.so which requires text relocation.

Detailed Description:

The httpd application attempted to load /usr/local/zend/lib/apache2/libphp5.so
which requires text relocation. This is a potential security problem. Most
libraries do not need this permission. Libraries are sometimes coded incorrectly
and request this permission. The SELinux Memory Protection Tests
(http://people.redhat.com/drepper/selinux-mem.html) web page explains how to
remove this requirement. You can configure SELinux temporarily to allow
/usr/local/zend/lib/apache2/libphp5.so to use relocation as a workaround, until
the library is fixed. Please file a bug report.

Allowing Access:

If you trust /usr/local/zend/lib/apache2/libphp5.so to run correctly, you can
change the file context to textrel_shlib_t. "chcon -t textrel_shlib_t
'/usr/local/zend/lib/apache2/libphp5.so'" You must also change the default file
context files on the system in order to preserve them even on a full relabel.
"semanage fcontext -a -t textrel_shlib_t
'/usr/local/zend/lib/apache2/libphp5.so'"

Fix Command:

chcon -t textrel_shlib_t '/usr/local/zend/lib/apache2/libphp5.so'

Additional Information:

Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:lib_t:s0
Target Objects                /usr/local/zend/lib/apache2/libphp5.so [ file ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           httpd-2.2.14-1.fc12
Target RPM Packages           mod-php-5.2-apache2-zend-server-5.2.13-14
Policy RPM                    selinux-policy-3.6.32-114.fc12
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   allow_execmod
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.32.11-99.fc12.i686.PAE #1 SMP Mon Apr 5
                              16:15:03 EDT 2010 i686 i686
Alert Count                   1
First Seen                    Fri 21 May 2010 05:40:56 AM MYT
Last Seen                     Fri 21 May 2010 05:40:56 AM MYT
Local ID                      0af74b19-a244-4e86-83ac-556e817577bf
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1274391656.266:6): avc:  denied  { execmod } for  pid=1650 comm="httpd" path="/usr/local/zend/lib/apache2/libphp5.so" dev=sda1 ino=263889 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:lib_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1274391656.266:6): arch=40000003 syscall=125 success=no exit=-13 a0=4666000 a1=5d8000 a2=5 a3=bff5aa80 items=0 ppid=1649 pid=1650 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)



Hash String generated from  allow_execmod,httpd,httpd_t,lib_t,file,execmod
audit2allow suggests:

#============= httpd_t ==============
allow httpd_t lib_t:file execmod;

Comment 1 Miroslav Grepl 2010-05-21 08:33:09 UTC
Execute the chcon command.

chcon -t textrel_shlib_t '/usr/local/zend/lib/apache2/libphp5.so'


I will make this the default labeling.

Comment 2 Miroslav Grepl 2010-05-21 12:17:39 UTC
Fixed in selinux-policy-3.6.32-116.fc12

Comment 3 Fedora Update System 2010-05-21 13:52:47 UTC
selinux-policy-3.6.32-116.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-116.fc12

Comment 4 Fedora Update System 2010-05-24 19:34:50 UTC
selinux-policy-3.6.32-116.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-116.fc12

Comment 5 Fedora Update System 2010-06-04 18:57:38 UTC
selinux-policy-3.6.32-116.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


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