Bug 467304 - SELinux is preventing totem-video-thumbnailer from making the program stack executable.
Summary: SELinux is preventing totem-video-thumbnailer from making the program stack e...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: totem
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bastien Nocera
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 467108 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-16 19:21 UTC by Allan Engelhardt
Modified: 2009-05-02 20:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-02 20:13:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output from gst-inspect-0.10 (13.48 KB, text/plain)
2008-10-17 05:42 UTC, Allan Engelhardt
no flags Details

Description Allan Engelhardt 2008-10-16 19:21:37 UTC
Description of problem:
With enforcing SELinux settings and allow_execstack set to off, totem-video-thumbnailer causes a SELinux violation every time you navigate nautilus to a directory with videos

Version-Release number of selected component (if applicable):
totem-2.23.2-7.fc9.x86_64
selinux-policy-targeted-3.3.1-99.fc9.noarch

How reproducible:
Always


Steps to Reproduce:
1. setsebool allow_execstack=0
2. Start nautilus on a directory with (thumbnail-able) videos
3. Use setroubleshoot or similar to view the alerts
  
Actual results: From setroubleshoot

+++[cut]+++

Summary:

SELinux is preventing totem-video-thu from making the program stack executable.

Detailed Description:

The totem-video-thu 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 totem-video-thu 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
totem-video-thu to run correctly, you can change the context of the executable
to unconfined_execmem_exec_t. "chcon -t unconfined_execmem_exec_t
'/usr/bin/totem-video-thumbnailer'" 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/totem-video-thumbnailer'"

Fix Command:

chcon -t unconfined_execmem_exec_t '/usr/bin/totem-video-thumbnailer'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:SystemLow-
                              SystemHigh
Target Context                unconfined_u:unconfined_r:unconfined_t:SystemLow-
                              SystemHigh
Target Objects                None [ process ]
Source                        gnome-settings-
Source Path                   /usr/libexec/gnome-settings-daemon
Port                          <Unknown>
Host                          xxx
Source RPM Packages           totem-2.23.2-7.fc9
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-99.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   allow_execstack
Host Name                     xxx
Platform                      Linux xxx 2.6.26.5-45.fc9.x86_64 #1
                              SMP Sat Sep 20 03:23:12 EDT 2008 x86_64 x86_64
Alert Count                   7
First Seen                    Thu 16 Oct 2008 14:36:37 BST
Last Seen                     Thu 16 Oct 2008 20:12:08 BST
Local ID                      f06ab78d-136f-4857-82dd-56cd8ecf0341
Line Numbers                  

Raw Audit Messages            

host=xxx type=AVC msg=audit(1224184328.524:119): avc:  denied  { execstack } for  pid=12420 comm="totem-video-thu" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process

host=xxx type=SYSCALL msg=audit(1224184328.524:119): arch=c000003e syscall=10 success=no exit=-13 a0=7fff186b2000 a1=1000 a2=1000007 a3=32d000 items=0 ppid=3257 pid=12420 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="totem-video-thu" exe="/usr/bin/totem-video-thumbnailer" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)


---[cut]---


Expected results:
No alerts, ideally by not changing the stack but at least by correct file labels.


Additional info:
No special video drivers installed (using stock Fedora nv driver)

Comment 1 Bastien Nocera 2008-10-16 19:31:33 UTC
You have third-party gstreamer plugins that require execmem though. Could you please remove all your third-party GStreamer plugins and let me know whether you still see the same problem?

Comment 2 Allan Engelhardt 2008-10-16 20:14:11 UTC
I removed the foreign gstreamer plugins and still see the problem.

I now have

# rpm -qa | grep '^gstreamer-*' | sort
gstreamer-0.10.20-1.fc9.x86_64
gstreamer-devel-0.10.20-1.fc9.x86_64
gstreamer-plugins-base-0.10.19-2.fc9.x86_64
gstreamer-plugins-base-devel-0.10.19-2.fc9.x86_64
gstreamer-plugins-farsight-0.12.7-2.fc9.x86_64
gstreamer-plugins-flumpegdemux-0.10.15-2.fc9.x86_64
gstreamer-plugins-good-0.10.8-8.fc9.x86_64
gstreamer-plugins-good-devel-0.10.8-8.fc9.x86_64
gstreamer-plugins-pulse-0.9.5-0.5.svn20070924.fc9.x86_64
gstreamer-plugins-schroedinger-1.0.3-2.fc9.x86_64
gstreamer-python-0.10.11-2.fc9.x86_64
gstreamer-tools-0.10.20-1.fc9.x86_64

and I get the messages below even though the thumbnail is now just a generic film reel image.

+++[cut]+++

Summary:

SELinux is preventing totem-video-thu from making the program stack executable.

Detailed Description:

The totem-video-thu 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 totem-video-thu 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
totem-video-thu to run correctly, you can change the context of the executable
to unconfined_execmem_exec_t. "chcon -t unconfined_execmem_exec_t
'/usr/bin/totem-video-thumbnailer'" 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/totem-video-thumbnailer'"

Fix Command:

chcon -t unconfined_execmem_exec_t '/usr/bin/totem-video-thumbnailer'

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:SystemLow-
                              SystemHigh
Target Context                unconfined_u:unconfined_r:unconfined_t:SystemLow-
                              SystemHigh
Target Objects                None [ process ]
Source                        gnome-settings-
Source Path                   /usr/libexec/gnome-settings-daemon
Port                          <Unknown>
Host                          server.cybaea.net
Source RPM Packages           totem-2.23.2-7.fc9
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-99.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   allow_execstack
Host Name                     xxx
Platform                      Linux xxx 2.6.26.5-45.fc9.x86_64 #1
                              SMP Sat Sep 20 03:23:12 EDT 2008 x86_64 x86_64
Alert Count                   52
First Seen                    Thu 16 Oct 2008 14:36:37 BST
Last Seen                     Thu 16 Oct 2008 21:11:30 BST
Local ID                      f06ab78d-136f-4857-82dd-56cd8ecf0341
Line Numbers                  

Raw Audit Messages            

host=xxx type=AVC msg=audit(1224187890.559:180): avc:  denied  { execstack } for  pid=13604 comm="totem-video-thu" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process

host=xxx type=SYSCALL msg=audit(1224187890.559:180): arch=c000003e syscall=10 success=no exit=-13 a0=7fff7b87f000 a1=1000 a2=1000007 a3=32d000 items=0 ppid=3257 pid=13604 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="totem-video-thu" exe="/usr/bin/totem-video-thumbnailer" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)



---[cut]---

Comment 3 Bastien Nocera 2008-10-16 20:41:40 UTC
Could you please attach the full output of gst-inspect-0.10, and try removing the gstreamer-plugins-farsight and gstreamer-plugins-schroedinger packages?

Comment 4 Allan Engelhardt 2008-10-17 05:40:20 UTC
> Could you please attach the full output of gst-inspect-0.10, and try removing
> the gstreamer-plugins-farsight and gstreamer-plugins-schroedinger packages?

I still get the SELinux error with the two extra packages removed such that I now have:

# rpm -qa | grep '^gstreamer-*' | sort
gstreamer-0.10.20-1.fc9.x86_64
gstreamer-devel-0.10.20-1.fc9.x86_64
gstreamer-plugins-base-0.10.19-2.fc9.x86_64
gstreamer-plugins-base-devel-0.10.19-2.fc9.x86_64
gstreamer-plugins-flumpegdemux-0.10.15-2.fc9.x86_64
gstreamer-plugins-good-0.10.8-8.fc9.x86_64
gstreamer-plugins-good-devel-0.10.8-8.fc9.x86_64
gstreamer-plugins-pulse-0.9.5-0.5.svn20070924.fc9.x86_64
gstreamer-python-0.10.11-2.fc9.x86_64
gstreamer-tools-0.10.20-1.fc9.x86_64

I'll add the gst-inspect output as an attachment.  I have a lot of Livna packages installed, but obviously no more foreign gstreamer plugins.

Comment 5 Allan Engelhardt 2008-10-17 05:42:32 UTC
Created attachment 320639 [details]
Output from gst-inspect-0.10

Output from gst-inspect-0.10 as requested in Comment #3.

Comment 6 Bastien Nocera 2009-04-24 13:39:53 UTC
If you still have the problem, then we need to find which of the plugins caused that problem. The easiest would be to move all the files away from /usr/lib64/gstreamer-0.10, and move them back in one by one to check which one is causing those problems.

Comment 7 Bastien Nocera 2009-04-24 14:49:54 UTC
*** Bug 467108 has been marked as a duplicate of this bug. ***

Comment 8 Allan Engelhardt 2009-04-25 08:27:03 UTC
The problem appears to have moved to Nautilus so I am guessing it is related to the Nautilus ("plugin"?) integration:

+++[cut]+++


Summary:

SELinux is preventing nautilus from making the program stack executable.

Detailed Description:

The nautilus 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 nautilus 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 nautilus to
run correctly, you can change the context of the executable to
unconfined_execmem_exec_t. "chcon -t unconfined_execmem_exec_t
'/usr/bin/nautilus'" 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/nautilus'"

Fix Command:

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

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:s0
Target Context                unconfined_u:unconfined_r:unconfined_t:s0
Target Objects                None [ process ]
Source                        nautilus
Source Path                   /usr/bin/nautilus
Port                          <Unknown>
Host                          xxx
Source RPM Packages           nautilus-2.24.2-3.fc10
Target RPM Packages           
Policy RPM                    selinux-policy-3.5.13-55.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   allow_execstack
Host Name                     xxx
Platform                      Linux xxx
                              2.6.27.21-170.2.56.fc10.x86_64 #1 SMP Mon Mar 23
                              23:08:10 EDT 2009 x86_64 x86_64
Alert Count                   1
First Seen                    Sat 25 Apr 2009 09:18:31 BST
Last Seen                     Sat 25 Apr 2009 09:18:31 BST
Local ID                      5915110c-8c92-4c0d-99f9-063b3072a20c
Line Numbers                  

Raw Audit Messages            

node=server.cybaea.net type=AVC msg=audit(1240647511.981:36): avc:  denied  { execstack } for  pid=3982 comm="nautilus" scontext=unconfined_u:unconfined_r:unconfined_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0 tclass=process

node=server.cybaea.net type=SYSCALL msg=audit(1240647511.981:36): arch=c000003e syscall=10 success=yes exit=0 a0=7fff19101000 a1=1000 a2=1000007 a3=7fdc11102000 items=0 ppid=3704 pid=3982 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="nautilus" exe="/usr/bin/nautilus" subj=unconfined_u:unconfined_r:unconfined_t:s0 key=(null)


---[cut]---

Comment 9 Bastien Nocera 2009-04-25 13:09:13 UTC
nautilus uses GStreamer through the audio/video properties tab (which comes from totem). I still need you to find out which plugin causes this though.

Comment 10 Allan Engelhardt 2009-05-02 20:13:41 UTC
Thank you Bastien: I followed your instructions and located the problem in a non-Fedora package.  My apologies for raising the bug in the first instance.

For reference, the plugin is libgstffmpeg.so from gstreamer-ffmpeg-0.10.5-1.fc10.x86_64 provided by our friends at http://rpmfusion.org/


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