LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: dhowells@redhat.com, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] KEYS: Add keyctl function to get a security label
Date: Wed, 13 Feb 2008 12:38:39 +0000	[thread overview]
Message-ID: <8165.1202906319@redhat.com> (raw)
In-Reply-To: <20080212155137.d07f80b7.akpm@linux-foundation.org>

Andrew Morton <akpm@linux-foundation.org> wrote:

> > +	key_ref = lookup_user_key(NULL, keyid, 0, 1, KEY_VIEW);
> > +	if (IS_ERR(key_ref)) {
> > +		if (PTR_ERR(key_ref) != -EACCES)
> > +			return PTR_ERR(key_ref);
> > +
> > +		/* viewing a key under construction is also permitted if we
> > +		 * have the authorisation token handy */
> > +		instkey = key_get_instantiation_authkey(keyid);
> > +		if (IS_ERR(instkey))
> > +			return PTR_ERR(key_ref);
> > +		key_put(instkey);
> 
> This check looks a wee bit racy?

It's not particularly racy.  Admittedly there's a tiny window in which we can
retrieve the security label of a key for which we had an authorisation token
that got revoked just as we completed our access checks on it.  Does this
matter?

David

      parent reply	other threads:[~2008-02-13 12:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 16:04 [PATCH 1/4] KEYS: Increase the payload size when instantiating a key David Howells
2008-02-08 16:04 ` [PATCH 2/4] KEYS: Check starting keyring as part of search David Howells
2008-02-12 23:47   ` Andrew Morton
2008-02-13 12:35   ` David Howells
2008-02-08 16:04 ` [PATCH 3/4] KEYS: Allow the callout data to be passed as a blob rather than a string David Howells
2008-02-08 16:04 ` [PATCH 4/4] KEYS: Add keyctl function to get a security label David Howells
2008-02-12 23:51   ` Andrew Morton
2008-02-13 12:38   ` David Howells [this message]

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=8165.1202906319@redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH 4/4] KEYS: Add keyctl function to get a security label' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).