Bug 613604

Summary: SELinux is preventing /usr/bin/wine-preloader from loading /home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll which requires text relocation.
Product: [Fedora] Fedora Reporter: kristinn <kiddigh>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: aderbal.ribeiro, dwalsh, kiddigh, mbooth, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:3f0caf466e8435a84c36227f3c1d2f46e55db7765b6aeaed2a077524a4a2bb48
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-12 16:42:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description kristinn 2010-07-12 12:05:26 UTC
Summary:

SELinux is preventing /usr/bin/wine-preloader from loading
/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll
which requires text relocation.

Detailed Description:

The rundll32.exe application attempted to load
/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll
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
/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll to
use relocation as a workaround, until the library is fixed. Please file a bug
report.

Allowing Access:

If you trust
/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll to
run correctly, you can change the file context to textrel_shlib_t. "chcon -t
textrel_shlib_t
'/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll'"
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
'/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll'"

Fix Command:

chcon -t textrel_shlib_t
'/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_execmem_t:s0-
                              s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/kiddigh/.wine/drive_c/windows/system32/gecko
                              /1.0.0/wine_gecko/ssl3.dll [ file ]
Source                        rundll32.exe
Source Path                   /usr/bin/wine-preloader
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           wine-core-1.2.0-0.6.rc6.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-33.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   allow_execmod
Host Name                     (removed)
Platform                      Linux (removed) 2.6.33.6-147.fc13.i686.PAE #1 SMP
                              Tue Jul 6 22:24:44 UTC 2010 i686 i686
Alert Count                   35
First Seen                    mán 12.júl 2010, 12:02:40 GMT
Last Seen                     mán 12.júl 2010, 12:02:41 GMT
Local ID                      f7824632-43a5-4b83-9e8b-8ef74274477a
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1278936161.491:27016): avc:  denied  { execmod } for  pid=4330 comm="rundll32.exe" path="/home/kiddigh/.wine/drive_c/windows/system32/gecko/1.0.0/wine_gecko/ssl3.dll" dev=dm-0 ino=263702 scontext=unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1278936161.491:27016): arch=40000003 syscall=125 success=no exit=-13 a0=1fc0000 a1=1000 a2=5 a3=0 items=0 ppid=4316 pid=4330 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=2 comm="rundll32.exe" exe="/usr/bin/wine-preloader" subj=unconfined_u:unconfined_r:unconfined_execmem_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  allow_execmod,rundll32.exe,unconfined_execmem_t,user_home_t,file,execmod
audit2allow suggests:

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

allow unconfined_execmem_t user_home_t:file execmod;

Comment 1 Miroslav Grepl 2010-07-12 16:42:07 UTC
Turn on the boolean allow_execmod.

# setsebool -P allow_execmod 1

Comment 2 Matthew Booth 2010-08-04 21:46:23 UTC
Would it not be worth specifically labelling ~/.wine, and having a flag to allow execmod just from that location?

Comment 3 Daniel Walsh 2010-08-05 12:36:05 UTC
I guess we could add a wine_home_t and allow execmod of the contents of ~/.wine