Bug 226873

Summary: svgalib will not load unless libraries are copied to usb drive
Product: [Fedora] Fedora Reporter: mcconnau
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: meyering
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-05 15:36:22 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:

Description mcconnau 2007-02-01 20:10:09 UTC
Description of problem:
I installed FC6 from CD set (checksums verified), then installed svgalib
(www.svgalib.org) both versions 1.4.3 and 1.9.25.  After building according to
instructions (with a few changes mainly to correct new compiler issues in 1.4.3)
I tried to run a demo.  It fails to load libraries, complaining that it cannot
restore segment protection after relocation.  Same result by doing ldd -r on the
libraries.  The problem is resolved and the demos run after I copy the libraries
to a usb thumb-drive and change the links in /usr/local/lib to point there.  I
was running as root and had full permissions on all directories in the path to
the demo program and the libraries, and on those files.  I have used svgalib on
several other Linux distros, including a Fedora Core laptop installation from
Emperor Linux, without running into this issue.  I can't think how to determine
whether this is a FC6 issue or svgalib issue.

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


How reproducible:
completely

Steps to Reproduce:
see above

Comment 1 Tim Waugh 2007-02-05 15:26:10 UTC
Fixing component and reassigning.

Comment 2 Jakub Jelinek 2007-02-05 15:36:22 UTC
You built svgalib incorrectly (or it has buggy Makefiles?).
Shared libraries need to be built as position independent code (i.e. using
-fpic or -fPIC compile time flags).
In FC6 the SELinux policy by default disallows DT_TEXTREL shared libraries
(on some arches like x86_64 DT_TEXTREL has never been supported at all), unless
the library uses a special SELinux type (e.g. textrel_shlib_t).
On the USB thumb drive guess you don't have a filesystem that supports SELinux
ACLs.

The best fix is just make sure the library is built with -fpic.  As a fallback,
if it is not (easily) possible to fix it, you can chcon -t textrel_shlib_t the
shared library.