public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: sds@tycho.nsa.gov, linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov
Subject: Re: [RFC PATCH 2/2] SELinux: cache inode checks inside struct inode
Date: Mon, 03 Jun 2013 19:18:21 -0400	[thread overview]
Message-ID: <1370301501.19018.9.camel@localhost> (raw)
In-Reply-To: <alpine.LFD.2.03.1306040628420.25797@pixel.linux-foundation.org>

On Tue, 2013-06-04 at 06:31 +0900, Linus Torvalds wrote:
> 
> 
> On Mon, 3 Jun 2013, Eric Paris wrote:
> >  
> >  #ifdef CONFIG_SECURITY
> > +     seqcount_t              i_security_seqcount;
> > +     u32                     i_last_task_sid;
> > +     u32                     i_last_granting;
> > +     u32                     i_last_perms;
> > +     u32                     i_audit_allow;
> >       void                    *i_security;
> >  #endif
> 
> This is much too big. I was really hoping for "another word that the 
> security layer can use" or similar.

Not sure how that can work   :-(

> Something this big would be acceptable if it would be a *generic* security 
> cache, and others could use it too, and would avoid ever actually calling 
> into any security layer at all (ie we could do the checks entirely at the 
> VFS layer). Then it would be fine. But for just the fact that SELinux is 
> too slow? No.

There is nothing about it that can't be VFS-erized.  The fields are:

readlockless way to get the data
which task was allowed
which perms were allowed
what generation of security policy allowed it
what perms should be forced to call security hook anyway

defining "perms" from a VFS PoV is hard.

doing any of this with 'stacking' is hard.  Then again, I'm only so so
on the value of stacking.  I've waffled a few times...

I can do it entirely inside selinux, but we are still going to have the
cache hit you were originally seeing as we dereference isec to get the
info....



  reply	other threads:[~2013-06-03 23:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 18:59 [RFC PATCH 1/2] selinux: merge selinux_inode_permission and inode_has_perm Eric Paris
2013-06-03 18:59 ` [RFC PATCH 2/2] SELinux: cache inode checks inside struct inode Eric Paris
2013-06-03 20:26   ` Casey Schaufler
2013-06-04  1:00     ` Casey Schaufler
2013-06-03 21:31   ` Linus Torvalds
2013-06-03 23:18     ` Eric Paris [this message]
2013-06-04  2:52       ` Casey Schaufler
2013-06-03 19:33 ` [RFC PATCH 1/2] selinux: merge selinux_inode_permission and inode_has_perm Eric Paris

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=1370301501.19018.9.camel@localhost \
    --to=eparis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=torvalds@linux-foundation.org \
    /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