Bug 495211 - (staff_u) Zillion nautilus related AVC denials
Summary: (staff_u) Zillion nautilus related AVC denials
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 11
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Eric Paris
QA Contact: Fedora Extras Quality Assurance
: 518749 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2009-04-10 12:38 UTC by Matěj Cepl
Modified: 2018-04-11 11:19 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-06-28 11:47:24 UTC
Type: ---

Attachments (Terms of Use)
output of ausearch -m AVC | grep nautilus |grep denied (572.09 KB, text/plain)
2009-04-10 12:41 UTC, Matěj Cepl
no flags Details

Description Matěj Cepl 2009-04-10 12:38:07 UTC
When running nautilus I get many many AVC denials with various nautilus related actions (see attached log)


Comment 1 Matěj Cepl 2009-04-10 12:41:31 UTC
Created attachment 339086 [details]
output of ausearch -m AVC | grep nautilus |grep denied

Comment 2 Matthias Clasen 2009-04-11 04:21:29 UTC
thats gotta be some mislabeling problem

Comment 3 Daniel Walsh 2009-04-11 11:20:19 UTC

allow staff_t gnome_home_t:file execute;
allow staff_t mozilla_home_t:file execute;

Is allowed now in policy, unless you have 

allow_staff_exec_content turned off.

allow staff_t user_tmp_t:sock_file execute;

Looks like nautilus is doing an execute access check on a sock_file in /tmp, I don't think it makes any sense to execute a sock_file.

I will add dontaudit rules.

nautilus also is checking write access to /tmp/.X11-unix directory?

So I think the problem is nautilus running around checking access to files and directories using access?

Matthias, the reason Matej is seening all these avc's is because he is running with a confined user rather then unconfined_t,  Not related to a mislabeling.

Comment 4 Daniel Walsh 2009-04-11 11:22:26 UTC
If my thoughts are correct on why this is happening, it shows the problem of 

access generating the actual execute or write rather then just a getattr, which I believe is a kernel problem.

Comment 5 Stephen Smalley 2009-04-13 14:02:54 UTC
Not sure I follow, sounds like a topic for selinux list.
Do you want access(2) to only check SELinux getattr permission to the file, like a stat(2) call would?  Rather than checking read/write/execute?

At present, access(2) internally calls the kernel's permission() routine, which invokes both DAC and SELinux MAC checks for read/write/execute.

Comment 6 Daniel Walsh 2009-04-13 18:07:52 UTC
Yes, I would rather have it only generate the getattr access check for MAC.  Since it is not actually executing the code, but reading whether the code can be executed, via DAC.  So in my mind this is a getattr access check.

I understand that it will return the wrong answer on MAC.  Which is a problem.  Currently we have a dontaudit * krb_conf_t:file write; for every domain that uses kerberos, because the kerberos library does a access(/etc/krb5.conf, W_OK) check.  This means we can not tell when an confined domain actually tried to rewrite /etc/krb5.conf.  

So I would like to somehow answer the access(FILE, MODE) question correctly without generating any other then a getattr access violation.

Comment 7 Stephen Smalley 2009-04-13 18:26:19 UTC
It seems unwise to hardcode suppression of the auditing of the read/write/execute check (e.g. via _noaudit interface) if we are in fact going to return that result to the caller of access(2); otherwise, we get silent denials with no way to see them if they do in fact break the application.  So I think dontaudit rules are your best bet there for silencing those, and then the user still has the option to use semodule -DB to uncover them.

If you want to further add a getattr check on access(2), then that just requires adding a call to security_inode_getattr() to sys_faccessat().

Comment 8 Daniel Walsh 2009-04-13 18:49:01 UTC
But they are different.  And we are covering up potential attacks. If every single domain as a dontaudit read of /etc/shadow, because we do an Access check and dontaudit write of /etc/krb5.conf, we can not tell when these files are actually under attack.

How about a different check, getattrmac, which we can give to domains that check.

Or maybe this becomes a new class.

dontaudit abc_t shadow_t:access write;

Comment 9 Stephen Smalley 2009-04-13 19:18:56 UTC
If we use any permission check other than read/write/execute, then we have the potential for inconsistency between access(2) and open(2) with the same requested access, thereby breaking libraries and applications that are using access(2) to decide whether or not to even attempt an open(2) or fall back on an unprivileged code path, ala libkrb and /etc/krb.conf or pam_unix and /etc/shadow.

getattrmac is even worse, as it cannot distinguish read vs. write vs. execute.

Separate class leaves open the possibility of inconsistency and loses ability to distinguish based on the actual file class (e.g. dir vs. file vs. chr_file...).

I don't see a good option.  Might want to take it up on selinux list, cc Eric and James.

Comment 10 Daniel Walsh 2009-04-15 14:56:52 UTC
So now I either have to dontaudit all attemps by users to execute files in their home directory so that Nautilus will not cause hundreds of AVCs or add a policy for Nautilus which would be very difficult since it needs to be able to do everything the user can do.

staff_t + dontaudit HOME/TMP:file execute, +dontaudit HOME/TMP:{ dir file } read;

Comment 11 Daniel Walsh 2009-04-15 14:57:22 UTC
And transition to staff_t when executing any executable that it can execute.

Comment 12 Stephen Smalley 2009-04-15 15:44:09 UTC
I'll take it up on selinux list, as I don't think it is really something we can resolve in a bugzilla.

Comment 13 Alexander Larsson 2009-04-16 17:04:04 UTC
It seems like you're onto this, but yes, to confirm, nautilus uses "access" to determine wheter you're allowed to do things like execute a file. We do this instead of parsing the file mode in order to also correctly work with things like ACLs or selinux denying certain things.

So, from the point of nautilus I'd like selinux to report what would actually happen if we e.g. tried to execute something, but not report a violation if it was not allowed.

Comment 14 Eric Paris 2009-04-16 17:40:23 UTC
1) return from access should report what would actually happen if you tried to execute something.
     - absolutely, there is no reasonable discussion about having access say something is allowed but then it actually be denied.

2) not report a violation if it was not allowed
     - this is a harder thing.  I, for one, see it as a huge problem to usability if selinux is able to deny an operation, but doesn't tell you that it was denied.  I think the upstream discussion is going to give us something that will be able to address everyone's concerns, although it going to take some bit of ugliness in the selinux userspace tools to beat out the specifics.

Comment 15 Alexander Larsson 2009-04-20 10:26:50 UTC
I understand the hesitation to not report this at all. However, at least you need to be able to tell between the actual executing of something and seeing if it is possible.

Comment 16 Bug Zapper 2009-06-09 13:36:44 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:

Comment 17 Matěj Cepl 2009-08-17 08:50:08 UTC
Just to note that this is alive and kicking with nautilus-2.26.3-2.fc11.x86_64
and selinux-policy-targeted-3.6.12-77.fc11.noarch.

Comment 18 Daniel Walsh 2009-08-18 12:52:05 UTC
Eric, what is the current state of this.

It seems to have drifted off into the weeds.

Comment 19 Adam Tkac 2009-09-16 15:41:01 UTC
*** Bug 518749 has been marked as a duplicate of this bug. ***

Comment 20 Bug Zapper 2010-04-27 13:37:00 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Comment 21 Bug Zapper 2010-06-28 11:47:24 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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