Bug 501467

Summary: SELinux is preventing mplayer from making the program stack executable.
Product: [Fedora] Fedora Reporter: Greg Eldridge <greg>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 9CC: adam, dwalsh, greg, jkubin, mgrepl
Target Milestone: ---Keywords: SELinux
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-19 18:08:50 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:
Bug Depends On:    
Bug Blocks: 638590    

Description Greg Eldridge 2009-05-19 10:19:17 UTC
Description of problem:

Summary:

SELinux is preventing mplayer from making the program stack executable.

Detailed Description:

[SELinux is in permissive mode, the operation would have been denied but was
permitted due to permissive mode.]

The mplayer application attempted to make its stack executable. This is a
potential security problem. This should never ever be necessary. Stack memory is
not executable on most OSes these days and this will not change. Executable
stack memory is one of the biggest security problems. An execstack error might
in fact be most likely raised by malicious code. 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 mplayer 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.

Allowing Access:

Sometimes a library is accidentally marked with the execstack flag, if you find
a library with this flag you can clear it with the execstack -c LIBRARY_PATH.
Then retry your application. If the app continues to not work, you can turn the
flag back on with execstack -s LIBRARY_PATH. Otherwise, if you trust mplayer to
run correctly, you can change the context of the executable to
unconfined_execmem_exec_t. "chcon -t unconfined_execmem_exec_t
'/usr/bin/mplayer'" 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 unconfined_execmem_exec_t '/usr/bin/mplayer'"

Fix Command:

chcon -t unconfined_execmem_exec_t '/usr/bin/mplayer'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                None [ process ]
Source                        vlc
Source Path                   /usr/bin/vlc
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           mplayer-1.0-0.100.20090204svn.fc9
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-132.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Permissive
Plugin Name                   allow_execstack
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain
                              2.6.27.21-78.2.41.fc9.i686 #1 SMP Mon Mar 23
                              23:45:58 EDT 2009 i686 i686
Alert Count                   3121
First Seen                    Mon 04 May 2009 06:21:00 AM PDT
Last Seen                     Wed 06 May 2009 12:03:11 AM PDT
Local ID                      fa818513-0303-4a8b-864e-e72ab8100b2c
Line Numbers                  

Raw Audit Messages            

node=localhost.localdomain type=AVC msg=audit(1241593391.28:3319): avc:  denied  { execstack } for  pid=8849 comm="mplayer" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process

node=localhost.localdomain type=SYSCALL msg=audit(1241593391.28:3319): arch=40000003 syscall=125 success=yes exit=0 a0=bfbb4000 a1=1000 a2=1000007 a3=fffff000 items=0 ppid=8848 pid=8849 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=2 comm="mplayer" exe="/usr/bin/mplayer" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)




Version-Release number of selected component (if applicable):
(from shell (bash))
This is SMPlayer v. 0.6.7 (SVN r2831) running on Linux
Debug: This is SMPlayer v. 0.6.7 (SVN r2831) running on Linux
Debug: Compiled with Qt v. 4.4.3, using 4.5.0



How reproducible:
Launch smplayer try to play video file.

Steps to Reproduce:
1.  Launch /usr/bin/smplayer
2.  Attempt to load & play a movie.flv or movie.mp4
3.
  
Actual results:
Would not play.  SELinux prevented the playing.
Please see FULL ALERT TEXT ABOVE 

Expected results:
normal operation

Additional info:

From the setroubleshoot browser:  " Sometimes a library is accidentally marked with the execstack flag, if you find
a library with this flag you can clear it with the execstack -c LIBRARY_PATH.
Then retry your application. "
I followed the instructions above and executed the following as root.
 
# execstack -c execstack -c /usr/lib/libxvidcore.so.4.2

This seems to have stopped the errors & it now plays.


HTH

Greg

Comment 1 Greg Eldridge 2009-05-19 10:22:09 UTC
Summary:

SELinux is preventing mplayer from making the program stack executable.

Detailed Description:

The mplayer application attempted to make its stack executable. This is a
potential security problem. This should never ever be necessary. Stack memory is
not executable on most OSes these days and this will not change. Executable
stack memory is one of the biggest security problems. An execstack error might
in fact be most likely raised by malicious code. 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 mplayer 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.

Allowing Access:

Sometimes a library is accidentally marked with the execstack flag, if you find
a library with this flag you can clear it with the execstack -c LIBRARY_PATH.
Then retry your application. If the app continues to not work, you can turn the
flag back on with execstack -s LIBRARY_PATH. Otherwise, if you trust mplayer to
run correctly, you can change the context of the executable to
unconfined_execmem_exec_t. "chcon -t unconfined_execmem_exec_t
'/usr/bin/mplayer'" 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 unconfined_execmem_exec_t '/usr/bin/mplayer'"

Fix Command:

chcon -t unconfined_execmem_exec_t '/usr/bin/mplayer'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                None [ process ]
Source                        mplayer
Source Path                   /usr/bin/mplayer
Port                          <Unknown>
Host                          laptop01.meatplow.com
Source RPM Packages           mplayer-1.0-0.100.20090204svn.fc9.1
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-132.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   allow_execstack
Host Name                     laptop01.meatplow.com
Platform                      Linux laptop01.meatplow.com
                              2.6.27.21-78.2.41.fc9.i686 #1 SMP Mon Mar 23
                              23:45:58 EDT 2009 i686 i686
Alert Count                   2542
First Seen                    Wed 06 May 2009 07:59:23 PM PDT
Last Seen                     Tue 19 May 2009 12:54:16 AM PDT
Local ID                      7a7a42e2-e7e1-4518-9a6e-103684ea5bd1
Line Numbers                  

Raw Audit Messages            

node=laptop01.meatplow.com type=AVC msg=audit(1242719656.709:42): avc:  denied  { execstack } for  pid=9145 comm="mplayer" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process

node=laptop01.meatplow.com type=SYSCALL msg=audit(1242719656.709:42): arch=40000003 syscall=125 success=no exit=-13 a0=bfd40000 a1=1000 a2=1000007 a3=fffff000 items=0 ppid=9091 pid=9145 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="mplayer" exe="/usr/bin/mplayer" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

Comment 2 Greg Eldridge 2009-05-19 10:28:08 UTC
Hello,

Comment #1 is another 'Alert to SELinux's setroubleshoot browser.  I didn't know if this needed its own Bug-Report, so I just tagged it onto here.  I assume that I will be advised of proper behaviour if this is not correct.  The same issue appeared to be causing this SELinux Alert as well.

Thank You,
 
Greg Eldridge
greg [[at]] ie-entertainment ((dot)) com

Comment 3 Daniel Walsh 2009-05-19 18:08:50 UTC
THis is not a bug, you can either allow the program to run with executable stack or not run it.  If you want to allow executable stack programs then you need to turn on the allow_execstack boolean.

You can look to see if you have an executable stack library that is causing this problem


find / -exec execstack -q {} \;  2>/dev/null | grep ^X

Then attempt to clear the flag and see if the app still works.  Report this bug to that library

Comment 6 Fedora Update System 2010-06-17 19:23:42 UTC
java-1.6.0-openjdk-1.6.0.0-36.b18.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/java-1.6.0-openjdk-1.6.0.0-36.b18.fc11