All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Eric Paris <eparis@redhat.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: [RFC] Ability to allow undefined permissions and classes -v2
Date: Thu, 15 Feb 2007 13:05:35 -0500	[thread overview]
Message-ID: <1171562735.32574.5.camel@moss-spartans.epoch.ncsc.mil> (raw)
In-Reply-To: <1171395416.10871.37.camel@localhost.localdomain>

On Tue, 2007-02-13 at 14:36 -0500, Eric Paris wrote:
> On Tue, 2007-02-13 at 12:40 -0500, Stephen Smalley wrote:
> > On Tue, 2007-02-13 at 12:28 -0500, Eric Paris wrote:
> [snip snip]
> > > This is a vestige of the original av padding where I had to be concerned
> > > that p->p_classes.nprim was larger than kdefs->cts_len.  Since now I
> > > only use the array when making permission checks I can assume that I
> > > will never get a class from the check greater than the number of kernel
> > > classes defined.  So all that can be simplified to just
> > > p->undefined_perms = kzalloc(sizeof(u32)*kdefs->cts_len, GFP_KERNEL);
> > 
> > No - security_compute_av can also be called via selinuxfs to check
> > userland security classes (from libselinux for userspace object
> > managers).
> 
> I'm starting to wonder if the entire way I am constructing and using
> using my table might be wrong.  Right now I am finding the permissions
> which are defined in the kernel but are not defined in the policy,
> storing just those select permissions, and then adding those to the
> allow rules.  This works very well when I only consider the kernel and
> don't think about things in userspace.
> 
> But now I ask the question, do we/I want to extend this methodology to
> userspace classes and permissions?  Obviously I wouldn't be able to
> build the 'unknown perms' table for userspace since they are completely
> unknown!  Would it be better if I changed my approach to
> 
> Now:
> avd.allowed |= p->undefined_perms[tclass-1]
> 
> Possible
> avd.allowed |= (p->defined_perms[tclass-1]  ^ 0xffffffff)
> 
> It's not quite as directed.  Instead of only allowing the select
> permissions which we know are missing from policy we instead shotgun
> approach and allow everything not explicitly defined.  Maybe this allows
> buggy code to get allows which would have been caught and things like
> that, but at least it could work for userspace classes and perms.  Seems
> to me like this undefined perms problem will be worse in userspace than
> it is in the kernel.
> 
> Thoughts?  Or should I just stick with the ideas behind the patch below?

Keep it simple and directed.

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  parent reply	other threads:[~2007-02-15 18:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 19:43 [RFC] Ability to allow undefined permissions and classes -v2 Eric Paris
2007-02-13 12:27 ` Stephen Smalley
2007-02-13 17:28   ` Eric Paris
2007-02-13 17:40     ` Stephen Smalley
2007-02-13 17:41       ` Stephen Smalley
2007-02-13 17:49       ` Stephen Smalley
2007-02-13 17:57         ` Stephen Smalley
2007-02-13 19:36       ` Eric Paris
2007-02-14 18:10         ` Chad Sellers
2007-02-14 18:49           ` Eric Paris
2007-02-14 19:22             ` Joshua Brindle
2007-02-14 19:40               ` Eric Paris
2007-02-15 18:33               ` Stephen Smalley
2007-02-15 18:46                 ` Stephen Smalley
2007-02-15 19:05                   ` Eric Paris
2007-02-15 19:12                     ` Chad Sellers
2007-02-15 19:27                     ` Stephen Smalley
2007-02-15 19:42                       ` Stephen Smalley
2007-02-15 19:44                       ` Eric Paris
2007-02-15 19:49                         ` Stephen Smalley
2007-02-15 19:03                 ` Karl MacMillan
2007-02-15 19:19                   ` Stephen Smalley
2007-02-14 18:12         ` Joshua Brindle
2007-02-15 18:30           ` Eamon Walsh
2007-02-15 20:51             ` Stephen Smalley
2007-02-15 18:05         ` Stephen Smalley [this message]
2007-02-14 17:38     ` Chad Sellers

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=1171562735.32574.5.camel@moss-spartans.epoch.ncsc.mil \
    --to=sds@tycho.nsa.gov \
    --cc=eparis@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.