From: Eric Paris <eparis@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: libc-alpha@sourceware.org, dwalsh@redhat.com,
dmalcolm@redhat.com, sds@tycho.nsa.gov, segoon@openwall.com,
linux-security-module@vger.kernel.org
Subject: Re: Friendlier EPERM - Request for input
Date: Wed, 09 Jan 2013 14:43:57 -0500 [thread overview]
Message-ID: <1357760637.2593.55.camel@localhost> (raw)
In-Reply-To: <1357747463.2593.28.camel@localhost>
>On Wed, 2013-01-09 at 11:04 -0500, Eric Paris wrote:
> >Getting an EPERM/EACCES in userspace really kinda blows. As a user you
> >don't have any idea why you got it.
Stephen Smalley wrote:
> What if the denial was due to lacking sufficient permission to stat
> the file (in which case you shouldn't leak the file's attributes to the
> caller)?
>
> Also, the present inability of (unprivileged) userspace to distinguish
> DAC from MAC denials is relied upon to avoid any covert channel when
> the DAC check happens before the MAC check, as otherwise you leak
> information about the DAC attributes. If you are going to indicate to
> all of userspace whether it was DAC or MAC, you have to make sure that
> the MAC check / LSM hook always comes first in every case. Which then
> leads to lots of unnecessary MAC audit messages that would have been
> denied by DAC anyway.
I'd have to fall back to my original thought about who to expose this
information to:
> >Another thought was that some people might want to turn off the ability
> >to get this information. I don't see a reason a sysctl couldn't be used
> >to disable extended errno information if the admin so chose.
On systems with a strict security policy worried about such things this
would quite reasonably need to be disabled. But most of the reason
people turn off LSMs is because it gets in the way and they get pissed
getting an EPERM, checking rwx bits, having no idea WTF happened, and
then being REALLY pissed at the LSM when they figure out that was the
problem. I want to put it right there, out front, here is what went
wrong for the common case.
I mean, we sorta, kinda sometimes, poorly give this information. Isn't
DAC usually EPERM and LSMs usually EACCES. From a DAC PoV exposing the
DAC info is completely reasonable. You can't hide a stat(), even
setting chmod 000. So this is an LSM issue. Not an issue for
DAC/Capabilities/ACLs. We can add an LSM hook on the /proc file to make
sure nothing can get the data even if the global sysctl allows such
access.
We could if it was worth it make filling in the extended dial
information an LSM hook where you can check on a per denial basis. But
I don't see the need.
> Privileged userspace already has a way to identify when it was a MAC
> denial, via the audit logs. But those are considered
> security-sensitive, and so exposing that same information to
> unprivileged userspace will be a problem.
The audit log is complete crap from a usability PoV. If a web admin is
trying to figure out why his web server isn't serving out web pages
in /home he's going to look in the web server logs and see EPERM.
That's it. Now he has to start blindly guessing which of the many
possible reasons for EPERM is his problem. Wouldn't it be better if the
information was actually available? Using the audit log in real time is
a bloody nightmare. As the audit maintainer I know how to use ausearch,
but then again, as the SELinux maintainer I know how to figure out which
of the many possibilities from EPERM are the cause. But I want to make
it easier for a normal admin to figure that out.
I know many people are worried about information leaks, so I'll right up
front say lets add the sysctl to disable the interface for those who are
concerned about the metadata information leak. But for most of us I
want that data right when it happens, where it happens, so It can be
exposed, used, and acted upon by the admin trying to troubleshoot why
the shit just hit the fan.
-Eric
next prev parent reply other threads:[~2013-01-09 19:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 16:04 Friendlier EPERM - Request for input Eric Paris
2013-01-09 19:43 ` Eric Paris [this message]
2013-01-09 20:14 ` Casey Schaufler
2013-01-09 20:32 ` Eric Paris
2013-01-09 20:53 ` Casey Schaufler
2013-01-09 20:59 ` Jakub Jelinek
2013-01-09 21:09 ` Eric Paris
2013-01-09 22:17 ` Carlos O'Donell
2013-01-21 0:00 ` Eric W. Biederman
2013-01-21 0:59 ` Eric W. Biederman
2013-01-21 1:09 ` Mike Frysinger
2013-01-09 21:12 ` Casey Schaufler
2013-01-09 21:13 ` Eric Paris
2013-01-09 21:36 ` Casey Schaufler
2013-01-10 15:14 ` Tetsuo Handa
2013-01-10 16:34 ` Eric Paris
2013-01-11 13:00 ` Mimi Zohar
2013-01-12 5:08 ` Tetsuo Handa
2013-01-27 14:16 ` Rich Kulawiec
2013-01-12 7:23 ` Rob Landley
2013-01-12 20:27 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357760637.2593.55.camel@localhost \
--to=eparis@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=dwalsh@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
--cc=segoon@openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox