This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 590162 - SELinux is preventing StandaloneInit from loading /opt/<software_package>//lib/ which requires text relocation.
SELinux is preventing StandaloneInit from loading /opt/<software_package>//li...
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy (Show other bugs)
x86_64 Linux
low Severity urgent
: rc
: ---
Assigned To: Daniel Walsh
BaseOS QE Security Team
: SELinux
Depends On:
  Show dependency treegraph
Reported: 2010-05-07 17:13 EDT by mark-antec
Modified: 2010-05-11 13:55 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-05-10 14:01:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description mark-antec 2010-05-07 17:13:35 EDT
Description of problem:

SELinux is preventing StandaloneInit from loading /opt/<software_package>//lib/ which requires text relocation.

I ran the suggested command: #chcon -t textrel_shlib_t '/opt/<software_package>//lib/'

But it does not work. I need the /opt///lib/ to work so I can install the software program and its license manager properly. 

Thanks in advance for the help.


SELinux is preventing StandaloneInit from loading
/opt/<software_package>//lib/ which requires text relocation.

Detailed Description:

The StandaloneInit application attempted to load
/opt/<software_package>//lib/ 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( web page explains how to remove this requirement. You can configure SELinux temporarily to allow /opt/D<software_package>//lib/ to use relocation as a workaround, until the library is fixed. Please file a bug report
( against this package.

Allowing Access:

If you trust /opt/<software_package>//lib/ to run correctly, you
can change the file context to textrel_shlib_t. "chcon -t textrel_shlib_t
'/opt/<software_package>//lib/'" 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

The following command will allow this access:

chcon -t textrel_shlib_t '/opt/<software_package>//lib/'

Additional Information:

Source Context                user_u:system_r:unconfined_t
Target Context                system_u:object_r:lib_t
Target Objects                /opt/D<software_package>//lib/ [ file
Source                        StandaloneInit
Source Path                   /opt/<software_package>/bin/StandaloneInit
Port                          <Unknown>
Source RPM Packages           <software_package>
Target RPM Packages           <software_package>
Policy RPM                    selinux-policy-2.4.6-255.el5_4.4
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   allow_execmod
Host Name                     (removed)
Platform                      Linux (removed) 2.6.18-164.11.1.el5
                              #1 SMP Wed Jan 6 13:26:04 EST 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Fri 07 May 2010 03:16:44 PM CDT
Last Seen                     Fri 07 May 2010 03:20:58 PM CDT
Local ID                      d8f9cd8a-9164-4c53-8b29-88c70531cb12
Line Numbers                  

Raw Audit Messages            

host=localhost.(removed) type=AVC msg=audit(1273263658.607:137): avc:  denied  { execmod } for  pid=11230 comm="StandaloneInit" path="/opt/<software_package>//lib/" dev=dm-0 ino=68354803 scontext=user_u:system_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0 tclass=file type=SYSCALL msg=audit(1273263658.607:137): arch=c000003e syscall=10 success=no exit=-13 a0=2b3333584000 a1=38000 a2=5 a3=2b33335892e0 items=0 ppid=10497 pid=11230 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=1 comm="StandaloneInit" exe="/opt/<software_package>//bin/StandaloneInit" subj=user_u:system_r:unconfined_t:s0 key=(null)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Daniel Walsh 2010-05-10 14:01:55 EDT
The report tells you what to do.  Or set the boolean allow_execmod to remove the check.

setsebool -P allow_execmod 1 is built incorrectly.

explains the access.
Comment 2 mark-antec 2010-05-10 14:11:00 EDT

I run the ff. commands:

disable the selinux:
#echo 0 >/selinux/enforce

run this:
#chcon -t textrel_shlib_t /opt/<software_package>//lib/

and I was able to install the software.

Why do you think the is not built correctly?
Comment 3 Daniel Walsh 2010-05-10 14:37:18 EDT
It either was not built with -fPIC or it has some assembly code that is causing the executable to load the library as an executable and writable at the same time.

That is what execmod means.
Comment 4 mark-antec 2010-05-10 14:44:31 EDT
Does that mean even if the software is running now, I still need to run the command below to make sure will continue to work?

# setsebool -P allow_execmod 1

Comment 5 Daniel Walsh 2010-05-11 09:46:20 EDT
No, only if  you want to eliminate the AVC message.  Since this happened in January.  I would guess an update fixed it.  Is the library labeled textrel_shlib_t?
Comment 6 mark-antec 2010-05-11 10:01:58 EDT
I see. Is the update fix automatic?

No, the library is not labeled textrel_shlib_t.

It is labeled /lib.
Comment 7 Daniel Walsh 2010-05-11 11:08:09 EDT
ls -lZ /opt/<software_package>//lib/
Comment 8 mark-antec 2010-05-11 11:35:54 EDT
Here's the result:

[root@localhost ~]# ls -lZ /opt/DEMSolutions/EDEM_2.2/lib/
-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t /opt/DEMSolutions/EDEM_2.2/lib/

What to do next? Thanks.
Comment 9 Daniel Walsh 2010-05-11 13:36:19 EDT
Nothing that is correct, and that is why it is working.
Comment 10 mark-antec 2010-05-11 13:55:40 EDT
I see what you mean by the library. Thank you very much.

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