Bug 592169

Summary: SELinux is preventing chrome from loading /opt/google/chrome/libffmpegsumo.so which requires text relocation.
Product: [Fedora] Fedora Reporter: gopu_g84
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dwalsh, jackiehui, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:15fd6f61ce885efbf3ee67b7e150e77de34dcd6191a662c730108cbe57df2ba7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-17 13:52:38 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 gopu_g84 2010-05-14 05:38:13 UTC
Summary:

SELinux is preventing chrome from loading /opt/google/chrome/libffmpegsumo.so
which requires text relocation.

Detailed Description:

The chrome application attempted to load /opt/google/chrome/libffmpegsumo.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
/opt/google/chrome/libffmpegsumo.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.

Allowing Access:

If you trust /opt/google/chrome/libffmpegsumo.so to run correctly, you can
change the file context to textrel_shlib_t. "chcon -t textrel_shlib_t
'/opt/google/chrome/libffmpegsumo.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 '/opt/google/chrome/libffmpegsumo.so'"

Fix Command:

chcon -t textrel_shlib_t '/opt/google/chrome/libffmpegsumo.so'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:s0
Target Context                system_u:object_r:lib_t:s0
Target Objects                /opt/google/chrome/libffmpegsumo.so [ file ]
Source                        chrome
Source Path                   /opt/google/chrome/chrome
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           google-chrome-beta-5.0.375.29-46008
Target RPM Packages           google-chrome-beta-5.0.375.29-46008
Policy RPM                    selinux-policy-3.5.13-74.fc10
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   allow_execmod
Host Name                     (removed)
Platform                      Linux (removed) 2.6.27.41-170.2.117.fc10.i686 #1 SMP
                              Thu Dec 10 11:00:29 EST 2009 i686 athlon
Alert Count                   41
First Seen                    Thu 06 May 2010 11:42:59 AM IST
Last Seen                     Wed 12 May 2010 12:46:35 PM IST
Local ID                      71578ca9-8144-48cb-a16a-597a5e8734fe
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1273648595.459:22): avc:  denied  { execmod } for  pid=4343 comm="chrome" path="/opt/google/chrome/libffmpegsumo.so" dev=dm-0 ino=188929 scontext=unconfined_u:unconfined_r:unconfined_t:s0 tcontext=system_u:object_r:lib_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1273648595.459:22): arch=40000003 syscall=125 success=no exit=-13 a0=5b87000 a1=140000 a2=5 a3=bfb5e1c0 items=0 ppid=0 pid=4343 auid=501 uid=501 gid=501 euid=501 suid=501 fsuid=501 egid=501 sgid=501 fsgid=501 tty=(none) ses=1 comm="chrome" exe="/opt/google/chrome/chrome" subj=unconfined_u:unconfined_r:unconfined_t:s0 key=(null)



Hash String generated from  allow_execmod,chrome,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 Daniel Walsh 2010-05-14 13:00:46 UTC
Does 

# restorecon -R -v /opt/google

Change the label?


On F13 this is labeled textrel_shlib_t which would allow this access.

Comment 2 gopu_g84 2010-05-14 21:13:06 UTC
(In reply to comment #1)
> Does 
> 
> # restorecon -R -v /opt/google
> 
> Change the label?
> 
> 
> On F13 this is labeled textrel_shlib_t which would allow this access.    

I was unable to open Google Chrome after issuing the restorecon command. Please find the outputs below.

# restorecon -R -v /opt/google
restorecon reset /opt/google/chrome/libffmpegsumo.so context system_u:object_r:lib_t:s0->system_u:object_r:textrel_shlib_t:s0
restorecon reset /opt/google/chrome/libgcflashplayer.so context system_u:object_r:lib_t:s0->system_u:object_r:textrel_shlib_t:s0
restorecon reset /opt/google/chrome/chrome-sandbox context system_u:object_r:usr_t:s0->system_u:object_r:chrome_sandbox_exec_t:s0

$ ./chrome
./chrome: error while loading shared libraries: libnss3.so.1d: cannot open shared object file: No such file or directory

$ ls -lrt libnss3.so.1d
lrwxrwxrwx. 1 root root 15 2010-05-14 08:45 libnss3.so.1d -> /lib/libnss3.so

$ ls -lrt /lib/libnss3.so
ls: cannot access /lib/libnss3.so: No such file or directory


Afterwards, I reinstalled the Google Chrome package. It seems to be working fine now. SELinux is not throwing up any messages when I open Google Chrome.

Thanks for the help.