Bug 485706

Summary: db-control report does not work in SELinux Enforcing mode.
Product: Red Hat Satellite 5 Reporter: Brandon Perkins <bperkins>
Component: ServerAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: medium Docs Contact:
Priority: medium    
Version: 530CC: mmraka, mzazrivec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 19:12:08 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:
Bug Depends On:    
Bug Blocks: 457079    

Description Brandon Perkins 2009-02-16 14:32:04 UTC
Description of problem:
db-control report does not work in SELinux Enforcing mode.

Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL5-re20090213.1-i386-embedded-oracle

How reproducible:
Always.

Steps to Reproduce:
1. Install Satellite.
2. [root@rlx-3-14 ~]# su - oracle
3. -bash-3.2$ db-control report
  
Actual results:
Can't load '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /opt/apps/oracle/web/product/10.2.0/db_1/lib/libnnz10.so: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
Compilation failed in require at /usr/bin/db-control line 11.
BEGIN failed--compilation aborted at /usr/bin/db-control line 11.


Expected results:
Working db-control report output.

Additional info:
db-control report works fine in SELinux Permissive mode.

Comment 1 Jan Pazdziora 2009-02-16 14:56:19 UTC
Could you do

# semodule -l | grep oracle

? I assume due to the unconfined_devpts_t problem, SELinux modules are not loaded on this compose at all.

Also, rhn-installation.log will probably have something like

libsepol.print_missing_requirements: spacewalk's global requirements were not met: type/attribute oracle_port_t
libsemanage.semanage_link_sandbox: Link packages failed
/usr/sbin/semodule:  Failed!
libsepol.context_from_record: type cobbler_port_t is not defined
libsepol.context_from_record: could not create context structure
libsepol.port_from_record: could not create port structure for range 25152:25152 (tcp)
libsepol.sepol_port_modify: could not load port range 25152 - 25152 (tcp)
libsemanage.dbase_policydb_modify: could not modify record value
libsemanage.semanage_base_merge_components: could not merge local modifications into policy
/usr/sbin/semanage: Could not add port tcp/25152

it it.

I'm working on a fix.

Comment 2 Jan Pazdziora 2009-02-16 15:39:10 UTC
After fixing the unconfined_devpts_t issue, I got

Can't load '/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /opt/apps/oracle/web/product/10.2.0/db_1/lib/libocci.so.10.1: cannot restore segment prot after reloc: Permission denied at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/DynaLoader.pm line 230.
 at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm line 539.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/DB.pm line 18.
Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/5.8.8/Dobby/CLI/MiscCommands.pm line 21.
Compilation failed in require at /usr/bin/db-control line 11.
BEGIN failed--compilation aborted at /usr/bin/db-control line 11.

Comment 3 Jan Pazdziora 2009-02-16 15:43:20 UTC
The problem is that interactive oracle user has

LD_LIBRARY_PATH=/opt/apps/oracle/web/product/10.2.0/db_1/lib

set. So we are using

-rwxrwxr-x  oracle dba system_u:object_r:lib_t          /opt/apps/oracle/web/product/10.2.0/db_1/lib/libocci.so.10.1

instead of

-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t /usr/lib/oracle/10.2.0.4/client/lib/libocci.so.10.1

So:

su oracle -c 'db-control report' works.
su - oracle -c 'db-control report' does not

I'll change the context on /opt/apps/oracle/web/product/10.2.0/db_1/lib/libocci.so.10.1 but I wonder if it's correct that DBD::Oracle uses non-InstantClient libraries.

Comment 4 Jan Pazdziora 2009-02-16 16:08:06 UTC
The unconfined_devpts_t problem fixed in 2d664ad720651b3fd31dfd9afcb5050fd31aeab8, the libocci.so.10.1 in d4995d6ea8f2523a33a7cf47d1e74e49a2bec0db.

Comment 5 Jan Pazdziora 2009-02-24 12:31:00 UTC
With compose Satellite-5.3.0-RHEL5-re20090220.1 available, moving ON_QA.

Comment 6 wes hayutin 2009-03-09 21:05:33 UTC
[root@grandprix ~]# su - oracle
-bash-3.2$ db-control report
Tablespace                  Size    Used   Avail   Use%
DATA_TBS                    3.9G    3.1G  775.8M    81%
SYSAUX                      250M   64.4M  185.5M    26%
SYSTEM                      400M  239.9M    160M    60%
UNDO_TBS                    500M  177.5M  322.4M    36%
USERS                       128M     64K  127.9M     0%
-bash-3.2$ exit
logout
[root@grandprix ~]# getenforce 
Enforcing
[root@grandprix ~]#

Comment 7 Milan Zázrivec 2009-09-02 11:30:26 UTC
Verified in stage with the exact same results as stated in the comment
above -> RELEASE_PENDING

Comment 8 Brandon Perkins 2009-09-10 19:12:08 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html