All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Michael LeMay <mdlemay@epoch.ncsc.mil>
Cc: jmorris@redhat.com, selinux@tycho.nsa.gov, sds@tycho.nsa.gov,
	dhowells@redhat.com
Subject: Re: [PATCH] selinux: Kernel access key retention support for SELinux
Date: Thu, 01 Jun 2006 11:09:13 +0100	[thread overview]
Message-ID: <11225.1149156553@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <1149097853.2517.0.camel@moss-tarheels.epoch.ncsc.mil>

Michael LeMay <mdlemay@epoch.ncsc.mil> wrote:

> This revision of my patch incorporates a few more changes suggested
> by Stephen.  I eliminated the "lookup" permission, due to the possibility
> for kernel confusion, and because of its strange semantics (e.g. it was
> possible to write to a key without performing a lookup on it).

Remember: keys aren't files and they don't exactly follow UNIX filesystem
semantics.

I think the default permissions for a key must be only the possessor is allowed
to do anything to it or with it, and that the user should be granted some
things (setattr, for instance), and that no-one else should be granted
anything.

The default permissions probably need a good overhaul.

> I also added an unlink permission to the keys subsystem and SELinux, which
> is checked before a key is unlinked from a keyring.  I felt this change was
> fairly trivial and within the overall spirit of the patch, which is why I
> included it here.

It isn't as trivial as you think.  Unlink is implied by several operations you
haven't altered: link, add key, request key, clear keyring and search keyring.
This is because you can displace a key link from a keyring by adding a link to
another key of matching type and description.

> If any of you decide it should be split off into some other patch, I'd be
> glad to remove it.

It certainly needs be split off into its own patch as it's a fairly major
change.  Your changes in this area are also incomplete.

I also don't really want unlinkable keys for a number of reasons:

 (1) You can't get rid of them when they're dead (unless you allow a specific
     bypass).

 (2) If they're your keys, they eat your quota and but you may not be able to
     ditch them.

 (3) If someone accidentally zeroes the mask on the key, they're left with a
     key that they can't get rid of.

 (4) What are the semantics of dealing with a keyring that has a link to an
     unlinkable key within it?  Does the keyring become automatically
     unlinkable too?

 (5) How do we deal with an unlinkable session keyring?  Should this prevent
     someone joining a new session?  And should this affect all their heirs
     also?

I feel that unlinkability really should apply to the link to a key, not to the
key itself if we have it at all.

Why do you want unlinkable keys anyway?

> -#define	KEY_SETATTR	0x20	/* require permission to change attributes */
> +#define	KEY_SETATTR	0x40	/* require permission to change attributes */

NAK!  You may not change this as this will invalidate RHEL4's kernel and the
keyutils package.

David

--
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:[~2006-06-01 10:09 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-31 17:50 [PATCH] selinux: Kernel access key retention support for SELinux Michael LeMay
2006-05-31 18:29 ` Stephen Smalley
2006-06-01 10:13   ` David Howells
2006-05-31 20:42 ` James Morris
2006-06-01  9:32   ` David Howells
2006-06-01 14:26     ` James Morris
2006-06-01 14:36       ` David Howells
2006-06-01 10:09 ` David Howells [this message]
2006-06-01 11:39   ` Stephen Smalley
2006-06-01 12:27     ` David Howells
2006-06-01 14:21       ` Stephen Smalley
2006-06-01 14:52         ` Valdis.Kletnieks
     [not found]           ` <447F0093.3090601@lemaymd.com>
2006-06-01 15:17             ` Stephen Smalley
2006-06-01 15:25               ` Stephen Smalley
2006-06-01 14:40 ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2006-06-02 17:09 Frank L. Mayer
2006-06-02 17:53 ` Casey Schaufler
2006-06-02 13:45 Michael LeMay
2006-06-02 14:10 ` David Howells
2006-06-02 13:27 Michael LeMay
2006-06-02 13:38 ` David Howells
2006-06-01 18:26 Michael LeMay
2006-06-01 23:40 ` James Morris
2006-06-02  9:21 ` David Howells
2006-06-02 12:44   ` Michael LeMay
2006-06-02 13:02     ` David Howells
2006-06-02 13:08       ` Stephen Smalley
2006-06-02 13:25         ` David Howells
2006-06-02 13:28         ` Stephen Smalley
2006-06-02 13:30           ` Stephen Smalley
2006-06-02 13:30           ` David Howells
2006-06-02 13:52             ` Stephen Smalley
2006-06-02 13:53               ` David Howells
2006-06-02 15:54         ` Casey Schaufler
2006-05-25 16:50 Michael LeMay
2006-05-26  9:37 ` David Howells
2006-05-26 13:54   ` David Howells
2006-05-26 12:30 ` Stephen Smalley
2006-05-26 12:56   ` Stephen Smalley
2006-05-26 12:31 ` Stephen Smalley
2006-05-26 13:00 ` Stephen Smalley

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=11225.1149156553@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=jmorris@redhat.com \
    --cc=mdlemay@epoch.ncsc.mil \
    --cc=sds@tycho.nsa.gov \
    --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.