Bug 523874 - setroubleshoot: SELinux is preventing /usr/bin/nautilus from making the program stack executable.
Summary: setroubleshoot: SELinux is preventing /usr/bin/nautilus from making the ...
Alias: None
Product: Fedora
Classification: Fedora
Component: nautilus
Version: rawhide
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Tomáš Bžatek
QA Contact: Fedora Extras Quality Assurance
Whiteboard: setroubleshoot_trace_hash:59ef4353b89...
: 524446 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2009-09-16 23:40 UTC by Dawid Zamirski
Modified: 2015-03-03 22:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-10-01 13:24:37 UTC
Type: ---

Attachments (Terms of Use)

Description Dawid Zamirski 2009-09-16 23:40:55 UTC
The following was filed automatically by setroubleshoot:


SELinux is preventing /usr/bin/nautilus from making the program stack

Detailed Description:

[SELinux is in permissive mode. This access was not denied.]

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.

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 execmem_exec_t.
"chcon -t 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 execmem_exec_t '/usr/bin/nautilus'"

Fix Command:

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

Additional Information:

Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
Target Objects                None [ process ]
Source                        nautilus
Source Path                   /usr/bin/nautilus
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           nautilus-2.27.92-2.fc12
Target RPM Packages           
Policy RPM                    selinux-policy-3.6.31-5.fc12
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Permissive
Plugin Name                   allow_execstack
Host Name                     (removed)
Platform                      Linux (removed) 2.6.31-14.fc12.x86_64 #1
                              SMP Tue Sep 15 03:48:57 EDT 2009 x86_64 x86_64
Alert Count                   2
First Seen                    Wed 16 Sep 2009 07:40:27 PM EDT
Last Seen                     Wed 16 Sep 2009 07:40:27 PM EDT
Local ID                      3226dcfa-f9ee-4658-aed2-9b67ca60158d
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1253144427.289:379): avc:  denied  { execstack } for  pid=2982 comm="nautilus" 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=AVC msg=audit(1253144427.289:379): avc:  denied  { execmem } for  pid=2982 comm="nautilus" 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(1253144427.289:379): arch=c000003e syscall=10 success=yes exit=0 a0=7fff27b0c000 a1=1000 a2=1000007 a3=312b61aaf9 items=0 ppid=2874 pid=2982 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=31 comm="nautilus" exe="/usr/bin/nautilus" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

audit2allow suggests:

#============= unconfined_t ==============
allow unconfined_t self:process { execstack execmem };

Comment 1 Daniel Walsh 2009-09-17 17:53:33 UTC
Nautilus should not require execstack/execmem



If this is actually causing things to blow up you can turn on the allow_execstack boolean.

setsebool -P allow_execstack 1

Comment 2 Dawid Zamirski 2009-09-17 20:36:38 UTC

I've filled this bug via the ABRT in SETroubleshoot after I updated my rawhide install to latest policy and relabel on boot. I'm running SELinux in permissive mode so everything works well except I get the warnings sometimes. I know it's rawhide and things like that may happen often and I generally do not file BZ as it might be fixed in the next 'yum update'. I saw this particular alert since about a week so I thought it might be useful to BZ it.

Comment 3 Daniel Walsh 2009-09-17 21:04:49 UTC
Yes this is very useful.

Ordinarily during Fedora 11 we ran with the allow_execstack boolean turned on, because of buggy apps,  We are trying to make sure no apps in F12 that we ship require this priv, since it is somewhat dangerous.

Comment 4 Matthias Clasen 2009-09-25 15:25:20 UTC

Dan, is there any way to get a stacktrace from when this happens  ?

Dawid, do you have any nautilus plugins installed ? Say, nautilus-open-terminal or nautilus-actions ?

Comment 5 Daniel Walsh 2009-09-25 16:22:58 UTC
I guess you could ask the reporter to run strace on nautilus and try to get it to repeat.  He is probably seeing a mprot failure.  Of course since he is in permissive mode there will be no error in strace.

Comment 6 Dawid Zamirski 2009-09-25 16:31:18 UTC
Yes, I've got these installed:

nautilus.x86_64                              2.28.0-2.fc12             
nautilus-actions.x86_64                      1.12.0-1.fc12             
nautilus-extensions.x86_64                   2.28.0-2.fc12             
nautilus-open-terminal.x86_64                0.17-2.fc12               
nautilus-search-tool.x86_64                  0.3.0-3.fc12              
nautilus-sendto.x86_64                       2.28.0-1.fc12             

I also have seen this alert with epiphany (2.27.x - I did not get today's
update yet) and chromium (it's not in fedora). Since I run in permissive mode,
this is not a problem for me now but when final Fedora is released I'll switch
to enforcing mode. I know that we Fedora does not support software that does
not come from official repos (like the chromium) but I still would prefer to
keep the SELinux boolean on.
So now finally is my question: Is it feasible to enable exclusion of certain
binaries from execmem,stack etc protections and yet keep the global flag on so
that I can exclude eg chromium from the protection and keep the rest of the
system protected?

Comment 7 Dawid Zamirski 2009-09-25 16:32:17 UTC
PS. I'll run nautilus with strace as soon as I get back home from work :-)

Comment 8 Matthias Clasen 2009-09-26 01:24:21 UTC
Once you've figured out how to reproduce this and detect it in strace, you could remove the extensions one-by-one to see which one causes this.

Comment 9 Tomáš Bžatek 2009-09-29 16:07:53 UTC
Dawid, please note that not only nautilus-* packages provide extensions for nautilus, see the contents of /usr/lib64/nautilus/extensions-2.0 directory.

Comment 10 Tomáš Bžatek 2009-09-29 16:17:07 UTC
*** Bug 524446 has been marked as a duplicate of this bug. ***

Comment 11 Dawid Zamirski 2009-09-30 23:23:17 UTC
It seems that this has somehow fixed itself as I'm not getting this alert anymore since about a week. Previously I was getting at least one such warning per day and now nothing.. I did not change any booleans and I did not remove any of nautilus-related packages - just daily yum update.

Comment 12 Daniel Walsh 2009-10-01 13:24:37 UTC
Ok I can go with a miracle.

I will close for now and reopen if it happens again.

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