From: David Howells <dhowells@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: dhowells@redhat.com, steved@redhat.com, jmorris@namei.org,
	linux-security-module@vger.kernel.org, keyrings@linux-nfs.org,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Keyrings] [PATCH 7/9] KEYS: Permit in-place link replacement in keyring list
Date: Mon, 19 Mar 2012 15:39:00 +0000	[thread overview]
Message-ID: <14790.1332171540@redhat.com> (raw)
In-Reply-To: <20120319104432.56fe1e66@redhat.com>
Jeff Layton <jlayton@redhat.com> wrote:
> Why is it safe to use key_put(rcu_access_pointer(...)) ? Clearly that
> pointer will end up being dereferenced, right?
Simple.  This key_put() is called from within keyring_destroy() and that is
only ever called from the garbage collector - which is non-reentrant.  Add to
that that key_put() never actually destroys a now-unused key, but merely
schedules the gc for a future run, and it's *that* that searches out unused
keys and deletes them.
David
next prev parent reply	other threads:[~2012-03-19 15:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 11:02 [PATCH 1/9] KEYS: Allow special keyrings to be cleared David Howells
2012-02-08 11:03 ` [PATCH 2/9] keys: update the description with info about "logon" keys David Howells
2012-02-08 11:03 ` [PATCH 3/9] KEYS: Move the key config into security/keys/Kconfig David Howells
2012-02-08 11:03 ` [PATCH 4/9] KEYS: Reorganise keys Makefile David Howells
2012-02-08 11:03 ` [PATCH 5/9] KEYS: Announce key type (un)registration David Howells
2012-02-08 11:03 ` [PATCH 6/9] KEYS: Perform RCU synchronisation on keys prior to key destruction David Howells
2012-03-19 14:31   ` [Keyrings] " Jeff Layton
2012-02-08 11:04 ` [PATCH 7/9] KEYS: Permit in-place link replacement in keyring list David Howells
2012-03-19 14:44   ` [Keyrings] " Jeff Layton
2012-03-19 15:39   ` David Howells [this message]
2012-02-08 11:04 ` [PATCH 8/9] KEYS: Do LRU discard in full keyrings David Howells
2012-02-08 11:04 ` [PATCH 9/9] KEYS: Add invalidation support David Howells
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=14790.1332171540@redhat.com \
    --to=dhowells@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=jmorris@namei.org \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=steved@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).