Bug 470949 - ocp requires text relocations and writable memory segments
Summary: ocp requires text relocations and writable memory segments
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ocp
Version: 13
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Charles R. Anderson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-11 01:34 UTC by Charles R. Anderson
Modified: 2011-06-15 18:40 UTC (History)
2 users (show)

Fixed In Version: ocp-0.1.20-8.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-15 18:26:50 UTC


Attachments (Terms of Use)

Description Charles R. Anderson 2008-11-11 01:34:38 UTC
Description of problem:

SELinux is preventing ocp from changing a writable memory segment executable.
SELinux is preventing ocp from loading /usr/lib/ocp-0.1.15/devwmixf.so which
requires text relocation.

etc. for all files in /usr/lib/ocp-0.1.15/*.so

Version-Release number of selected component (if applicable):
ocp-0.1.15-4.fc10.i386

Actual results:

The ocp application attempted to change the access protection of memory (e.g.,
allocated using malloc). This is a potential security problem. Applications
should not be doing this. Applications 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. If ocp does not work and you need it to work, you can
configure SELinux temporarily to allow this access until the application is
fixed. Please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package.


The ocp application attempted to load /usr/lib/ocp-0.1.15/devwmixf.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/lib/ocp-0.1.15/devwmixf.so to use relocation as a workaround, until the
library is fixed. Please file a bug report
(http://bugzilla.redhat.com/bugzilla/enter_bug.cgi) against this package.


Additional info:

workaround:
chcon -t unconfined_execmem_exec_t /usr/bin/ocp-0.1.15
chcon -t textrel_shlib_t '/usr/lib/ocp-0.1.15/*.so

Comment 1 Bug Zapper 2008-11-26 05:10:02 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Bug Zapper 2009-11-18 08:49:15 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Bug Zapper 2010-03-15 12:08:53 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Bug Zapper 2011-06-02 18:25:16 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Charles R. Anderson 2011-06-02 21:00:33 UTC
I believe the reason for the text relocations is because the 32-bit version of ocp uses i386 assembly code.  Stian, is that the case?  If so, there is probably no easy way to remove this requirement without rewriting the assembly, but I defer to the experts on that one.

The x86_64 version is unaffected by this bug and does not require text relocations.

The original workaround:

chcon -t unconfined_execmem_exec_t /usr/bin/ocp-0.1.15
chcon -t textrel_shlib_t '/usr/lib/ocp-0.1.15/*.so

doesn't stick after package updates.  A more permanent workaround is:

semanage fcontext -a -t textrel_shlib_t '/usr/lib/ocp-.*/.*\.so'

I'll see about putting this into the package so it is handled automatically.

I also haven't needed to set unconfined_execmem_exec_t on the binary recently.  This might be because in a default Fedora 13 installation, the SELinux allow_execmem (and allow_execstack) boolean defaults to on.

Comment 6 Stian Skjelstad 2011-06-02 22:52:41 UTC
(In reply to comment #5)
> I believe the reason for the text relocations is because the 32-bit version of
> ocp uses i386 assembly code.  Stian, is that the case?  If so, there is
> probably no easy way to remove this requirement without rewriting the assembly,
> but I defer to the experts on that one.

That is correct, and it only affects 32bit. Possible workaround is to disable the assembler optimized versions of the mixer or rewrite the assembler to support -fPIC correctly. Currently the assembler only push/pop the ebx registers if PIC is detected.


Stian

Comment 7 Charles R. Anderson 2011-06-03 21:32:41 UTC
In default Fedora 14 and 15 installations, the SELinux booleans have different defaults:

Fedora 13 i386:

allow_execheap --> off
allow_execmem --> on
allow_execmod --> off
allow_execstack --> on

Fedora 14 i386:

allow_execheap --> off
allow_execmem --> on
allow_execmod --> on
allow_execstack --> off

Fedora 15 i386:

allow_execheap --> off
allow_execmem --> on
allow_execmod --> on
allow_execstack --> on

As a result, Fedora 14 & 15 by default permit the text relocations, so no workaround is required.

Comment 8 Fedora Update System 2011-06-06 05:30:19 UTC
ocp-0.1.20-8.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/ocp-0.1.20-8.fc14

Comment 9 Fedora Update System 2011-06-06 05:30:33 UTC
ocp-0.1.20-8.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/ocp-0.1.20-8.fc15

Comment 10 Fedora Update System 2011-06-06 05:30:46 UTC
ocp-0.1.20-8.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/ocp-0.1.20-8.fc13

Comment 11 Fedora Update System 2011-06-07 04:26:41 UTC
Package ocp-0.1.20-8.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ocp-0.1.20-8.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/ocp-0.1.20-8.fc15
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2011-06-15 18:26:39 UTC
ocp-0.1.20-8.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2011-06-15 18:39:18 UTC
ocp-0.1.20-8.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2011-06-15 18:40:02 UTC
ocp-0.1.20-8.fc13 has been pushed to the Fedora 13 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.