Bug 605916

Summary: SELinux is preventing /usr/bin/mythfrontend from loading /usr/lib/mythtv/filters/libgreedyhdeint.so which requires text relocation.
Product: [Fedora] Fedora Reporter: Richard Shaw <hobbes1069>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:3ac21809773283834a4dd363f9a80fcabd779054c87e6de1297aafdd6f484b90
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-21 10:45:14 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 Richard Shaw 2010-06-19 12:09:55 UTC
Summary:

SELinux is preventing /usr/bin/mythfrontend from loading
/usr/lib/mythtv/filters/libgreedyhdeint.so which requires text relocation.

Detailed Description:

The mythfrontend application attempted to load
/usr/lib/mythtv/filters/libgreedyhdeint.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/mythtv/filters/libgreedyhdeint.so to use relocation as a workaround,
until the library is fixed. Please file a bug report.

Allowing Access:

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

Fix Command:

chcon -t textrel_shlib_t '/usr/lib/mythtv/filters/libgreedyhdeint.so'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                system_u:object_r:lib_t:s0
Target Objects                /usr/lib/mythtv/filters/libgreedyhdeint.so [ file
                              ]
Source                        mythfrontend
Source Path                   /usr/bin/mythfrontend
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           mythtv-frontend-0.23-2.fc13
Target RPM Packages           mythtv-frontend-0.23-2.fc13
Policy RPM                    selinux-policy-3.7.19-23.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   allow_execmod
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.33.5-124.fc13.i686.PAE #1 SMP Fri Jun 11
                              09:42:24 UTC 2010 i686 i686
Alert Count                   26
First Seen                    Fri 18 Jun 2010 04:00:21 PM CDT
Last Seen                     Fri 18 Jun 2010 06:16:30 PM CDT
Local ID                      8c98f560-03c1-41ae-a758-fa1afd2a4495
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1276902990.697:20466): avc:  denied  { execmod } for  pid=3080 comm="mythfrontend" path="/usr/lib/mythtv/filters/libgreedyhdeint.so" dev=dm-0 ino=123387 scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=system_u:object_r:lib_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1276902990.697:20466): arch=40000003 syscall=125 success=no exit=-13 a0=c4d000 a1=4000 a2=5 a3=a9cfea80 items=0 ppid=2075 pid=3080 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm="mythfrontend" exe="/usr/bin/mythfrontend" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  allow_execmod,mythfrontend,unconfined_t,lib_t,file,execmod
audit2allow suggests:

#============= unconfined_t ==============
#!!!! This avc can be allowed using the boolean 'allow_execmod'

allow unconfined_t lib_t:file execmod;

Comment 1 Miroslav Grepl 2010-06-21 10:45:14 UTC
chcon -t textrel_shlib_t '/usr/lib/mythtv/filters/libgreedyhdeint.so'

will fix. To make this permanent

semanage fcontext -a -t textrel_shlib_t '/usr/lib/mythtv/filters/libgreedyhdeint.so'

Comment 2 Richard Shaw 2010-06-21 13:07:08 UTC
Yeah I saw the fix command, but I have couple of questions:

- Does the library require this access or does it need to be updated to not require this access?
- Why do I see this on my only i686 install of Fedora and Mythtv and not on any of my 3 x86_64 installs of Fedora/MythTV?
- If the library does require this label, do I also need to run the other command to prevent it from being changed back on a relabel?

Comment 3 Daniel Walsh 2010-06-21 14:37:28 UTC
Most likely the library is being built incorrectly.  Usually missing an -fPIC flag.

Not sure why it works on x86_64 versus i686.

semanage fcontext command makes it permanent.