mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: serue@us.ibm.com
To: David Howells <dhowells@redhat.com>
Cc: torvalds@osdl.org, akpm@osdl.org, keyrings@linux-nfs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Keys: Add LSM hooks for key management
Date: Wed, 5 Oct 2005 13:40:58 -0500	[thread overview]
Message-ID: <20051005184058.GA12008@sergelap.austin.ibm.com> (raw)
In-Reply-To: <29942.1128529714@warthog.cambridge.redhat.com>

> +int key_task_permission(const key_ref_t key_ref,
> +			struct task_struct *context,
> +			key_perm_t perm)
> +{
> +	struct key *key;
> +	key_perm_t kperm;
> +	int ret;
> +
> +	/* let the security module have first say
> +	 * - it should return:
> +	 *	+ve to grant access
> +	 *	0   to deny access
> +	 *	-ve to fall back to normal permission checking
> +	 */
> +	ret = security_key_permission(key_ref, context, perm);
> +	if (ret >= 0)
> +		return ret;

Hmm, my only problem here is that this is nonstandard compared to
expected return values from other security_ authorization hooks.
Could this be switched to

	-ve : deny access (and return the error)
	0: grant access
	+ve: fall back to normal permission checking

Actually that's still nonstandard.  On the whole, LSM only
restricts, does not authorize, with capable() being the notable
exception.  Is there good reason to allow LSMs to fully authorize
in this case?

thanks,
-serge

  parent reply	other threads:[~2005-10-05 18:41 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 [this message]
2005-10-05 21:10 ` 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
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=20051005184058.GA12008@sergelap.austin.ibm.com \
    --to=serue@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®