Bug 551063 - selinux prevents postgresql-test regression tests from succeeding
Summary: selinux prevents postgresql-test regression tests from succeeding
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy-targeted
Version: 5.5
Hardware: All
OS: Linux
high
low
Target Milestone: beta
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 550783
TreeView+ depends on / blocked
 
Reported: 2009-12-28 19:27 UTC by Tom Lane
Modified: 2013-07-03 03:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 07:49:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0182 0 normal SHIPPED_LIVE selinux-policy bug fix update 2010-03-29 12:19:53 UTC

Description Tom Lane 2009-12-28 19:27:50 UTC
Description of problem:
The postgresql regression tests include some .so files that need to be dynamically loaded by the postgresql server.  This worked last time I checked it in Fedora, but I find that selinux prevents it in RHEL5.5.  I get

ERROR:  could not load library "/usr/lib64/pgsql/test/regress/regress.so": /usr/lib64/pgsql/test/regress/regress.so: failed to map segment from shared object: Permission denied

although curiously there is nothing in /var/log/messages about it

Version-Release number of selected component (if applicable):
selinux-policy-2.4.6-267.el5

How reproducible:
100%

Steps to Reproduce:
1.  Install postgresql-test (and therefore also postgresql-server etc)
2.  service postgresql start
3.  su postgres
4.  cd /usr/lib(64)/pgsql/test/regress
5.  make check

Actual results:
several tests fail; all of the errors trace to being unable to load several .so files that are
installed in the regress directory.

Expected results:
regression tests should all pass

Additional info:
ls -Z shows the .so's are labeled postgresql_db_t which is probably the wrong thing.  On my F-11 box they show up as lib_t.

Comment 1 Daniel Walsh 2009-12-29 23:19:44 UTC
Miroslav, looks like we need

/var/lib(64)?/pgsql/.*\.so.*		--	gen_context(system_u:object_r:lib_t,s0)
/var/lib(64)?/pgsql/test/regress/.*\.so.*		--	gen_context(system_u:object_r:lib_t,s0)

Comment 2 Tom Lane 2009-12-30 00:39:36 UTC
/usr, please, not /var

Also, now that I'm looking at this, we should also allow loading libraries from

/usr/lib(64)?/pgsql/plugins/.*\.so.*

which is a subdirectory that's allowed in recent PG releases.

Comment 3 Daniel Walsh 2009-12-30 00:57:22 UTC
I guess I should not be doing this late night in a ski lodge.   

Sorry Tom.

Comment 5 Miroslav Grepl 2010-01-05 17:27:22 UTC
Fixed in selinux-policy-2.4.6-268.el5

Comment 9 errata-xmlrpc 2010-03-30 07:49:31 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/RHBA-2010-0182.html


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