Bug 642673 - SELinux is preventing /usr/libexec/gstreamer-0.10/gst-plugin-scanner from making the program stack executable.
Summary: SELinux is preventing /usr/libexec/gstreamer-0.10/gst-plugin-scanner from mak...
Keywords:
Status: CLOSED DUPLICATE of bug 652297
Alias: None
Product: Fedora
Classification: Fedora
Component: gstreamer
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Benjamin Otte
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: setroubleshoot_trace_hash:a687b643570...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-13 14:37 UTC by Joachim Frieben
Modified: 2011-01-09 18:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-28 20:09:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joachim Frieben 2010-10-13 14:37:29 UTC
Summary:

SELinux is preventing /usr/libexec/gstreamer-0.10/gst-plugin-scanner from making
the program stack executable.

Detailed Description:

The gst-plugin-scan 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://www.akkadia.org/drepper/selinux-mem.html) web page explains how to
remove this requirement. If gst-plugin-scan 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.

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
gst-plugin-scan to run correctly, you can change the context of the executable
to execmem_exec_t. "chcon -t execmem_exec_t
'/usr/libexec/gstreamer-0.10/gst-plugin-scanner'" 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 execmem_exec_t
'/usr/libexec/gstreamer-0.10/gst-plugin-scanner'"

Fix Command:

chcon -t execmem_exec_t '/usr/libexec/gstreamer-0.10/gst-plugin-scanner'

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                        gst-plugin-scan
Source Path                   /usr/libexec/gstreamer-0.10/gst-plugin-scanner
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           gstreamer-0.10.30-1.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.5-10.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   allow_execstack
Host Name                     (removed)
Platform                      Linux (removed) 2.6.35.6-39.fc14.x86_64 #1 SMP Fri
                              Oct 8 16:23:12 UTC 2010 x86_64 x86_64
Alert Count                   1
First Seen                    Wed 13 Oct 2010 04:36:12 PM CEST
Last Seen                     Wed 13 Oct 2010 04:36:12 PM CEST
Local ID                      954cf1c0-b070-4cfa-ba2d-63af1c17853f
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1286980572.20:115): avc:  denied  { execstack } for  pid=5291 comm="gst-plugin-scan" 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=(removed) type=SYSCALL msg=audit(1286980572.20:115): arch=c000003e syscall=10 success=no exit=-13 a0=7fff2c917000 a1=1000 a2=1000007 a3=7fb9bffe9000 items=0 ppid=5129 pid=5291 auid=501 uid=501 gid=100 euid=501 suid=501 fsuid=501 egid=100 sgid=100 fsgid=100 tty=(none) ses=1 comm="gst-plugin-scan" exe="/usr/libexec/gstreamer-0.10/gst-plugin-scanner" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)



Hash String generated from  allow_execstack,gst-plugin-scan,unconfined_t,unconfined_t,process,execstack
audit2allow suggests:

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

allow unconfined_t self:process execstack;

Comment 1 Daniel Walsh 2010-10-13 15:13:13 UTC
I don't think gstreamer should require execstack.

Comment 2 Benjamin Otte 2010-10-14 16:44:13 UTC
Considering that gst-plugin-scanner just initializes all GStreamer plugins to scan them, this sounds like a lot of places where this can be caused.
Is there a way to get a stack trace for SELinux audit failures?

Comment 3 Daniel Walsh 2010-10-14 19:15:31 UTC
First take a look at the shared library and see if it has the execstack flag turned on .

execstack -q

Comment 4 Benjamin Otte 2010-10-28 11:29:00 UTC
I can tell you that neither the GStreamer libraries nor any of the GStreamer plugins require execstack. That doesn't mean however that there might be plugins (that load other plugins) that link to libraries that are broken. Which is why I'm asking.

So unless there's a way to figure out what's causing the problem, I'm gonna close this as INSUFFICIENT_DATA.

Comment 5 pauwel coppieters 2010-12-28 10:43:59 UTC
On my system (Linux 2.6.35.10-74.fc14.i686) the libraries with the execstack flag are /usr/lib/libxvidcore.so.4 and /usr/lib/libxvidcore.so.4.2 (from xvidcore-1.2.2-1.fc14.i686) and these are used by libgstffmpeg.so and libgstpostproc.so from gstreamer-ffmpeg-0.10.11-1.fc14.i686 and libgstxvid.so from gstreamer-plugins-bad-0.10.20-2.fc14.i686.

Comment 6 Daniel Walsh 2010-12-28 13:14:02 UTC
If you turn the flag off, does everything work?

Comment 7 pauwel coppieters 2010-12-28 16:10:13 UTC
Hard to say if 'everything' works, but if I leave the execstack flag active, totem won't play an XVID file at all : If I remove ~/.gstreamer-0.10 and the run gst-inspect , this refuses to add the xvid library (because of the exestack flag).
and Totem reports it doesn't have a plugin to handle the xvid file.
If I remove the flag, and re-run gst-inspect, the xvid library is added, and totem does play the same xvid file.
I used the file http://samples.mplayerhq.hu/V-codecs/XVID/ttm1.avi to test (cause I don't have any XVID samples) and the quality is horrible. Don't know if it is the sample or somethings else.

Comment 8 Daniel Walsh 2010-12-28 20:09:22 UTC
Ok this means the flag is not necessary, I believe.  Not sure why the quality would stink, but I am pretty sure this is not caused by SELinux.

*** This bug has been marked as a duplicate of bug 652297 ***


Note You need to log in before you can comment on or make changes to this bug.