mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: David Howells <dhowells@redhat.com>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	keyrings@linux-nfs.org, linux-kernel@vger.kernel.org,
	Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [Keyrings] [PATCH] Keys: Add LSM hooks for key management
Date: Thu, 6 Oct 2005 12:14:13 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.63.0510061204040.26937@excalibur.intercode> (raw)
In-Reply-To: <30054.1128611494@warthog.cambridge.redhat.com>

On Thu, 6 Oct 2005, David Howells wrote:

> > > Should I expand the permissions mask to include a setattr?
> > 
> > Possibly for setperm and chown.
> 
> For setperm?

It changes an attribute of a key, for which you have DAC checks, therefore 
you could assume that we'd also want MAC checks.

> > > > All users of key_permission() need to propagate the error code from the 
> > > > LSM back to the user.
> > > 
> > > Really? Why?
> > 
> > Because the LSM has final say on the error code returned to the caller.  
> > If the LSM runs out of memory, for example, it's silly to return -EACCES.
> > 
> > > Note that the fact that key_permission() fails for a key is sometimes
> > > ignored, such as when I'm doing a search and one potentially matching key
> > > fails, but a subsequent matching key passes.
> > 
> > Ok, that sounds like an internal issue to be resolved, ensuring that if 
> > you are returning to the caller, the LSM's error code is returned.
> 
> But which LSM error code?
> 
> Let me explain what I mean:

[snipped]

Thanks for the detailed explanation.

Not sure yet how we'll avoid generating spurious SELinux denial messages.

> Only if all these fail does the whole thing fail with the highest priority
> error. Note that several errors may have come from LSM.
> 
> The error priority should be:
> 
> 	EKEYREVOKED > EKEYEXPIRED > ENOKEY
> 
> EACCES/EPERM should only really be returned on a direct keyring search where
> the basal keyring doesn't have Search permission.

Ok, if a failure of this nature is generated by an LSM, we need to return 
the LSM's error code (e.g. ask the LSM for search permission and it 
returns -ENOMEM).

> The fact that I couldn't find a key because I didn't have permission to find
> it probably shouldn't cause an immediate abort of the search with an error, or
> any error other than ENOKEY/EKEYREVOKED/EKEYEXPIRED, unless I'm not permitted
> to request a new key.

Ok.


- James
-- 
James Morris
<jmorris@namei.org>

  reply	other threads:[~2005-10-06 16:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-05 16:28 David Howells
2005-10-05 16:44 ` [Keyrings] " James Morris
2005-10-05 16:48 ` David Howells
2005-10-05 19:31   ` James Morris
2005-10-05 18:40 ` serue
2005-10-05 21:10 ` [Keyrings] " Chris Wright
2005-10-06  8:03   ` James Morris
2005-10-06 10:54   ` David Howells
2005-10-06 15:04     ` James Morris
2005-10-06 15:18     ` David Howells
2005-10-06 16:02       ` James Morris
2005-10-07  8:50       ` David Howells
2005-10-07 18:36         ` Chris Wright
2005-10-06 17:58     ` Chris Wright
2005-10-07  9:10     ` David Howells
2005-10-07 12:59       ` Stephen Smalley
2005-10-07 18:51       ` Chris Wright
2005-10-06  8:38 ` James Morris
2005-10-06 10:30 ` David Howells
2005-10-06 23:10   ` Chris Wright
2005-10-07  9:57   ` David Howells
2005-10-07 19:36     ` Chris Wright
2005-10-06 11:06 ` David Howells
2005-10-06 14:25   ` James Morris
2005-10-06 15:11   ` David Howells
2005-10-06 16:14     ` James Morris [this message]
2005-10-07  9:03     ` David Howells
2005-10-07 14:05       ` James Morris

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=Pine.LNX.4.63.0510061204040.26937@excalibur.intercode \
    --to=jmorris@namei.org \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=torvalds@osdl.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

Powered by JetHome