[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120319104432.56fe1e66@redhat.com>
Date: Mon, 19 Mar 2012 10:44:32 -0400
From: Jeff Layton <jlayton@...hat.com>
To: David Howells <dhowells@...hat.com>
Cc: steved@...hat.com, jmorris@...ei.org,
linux-security-module@...r.kernel.org, keyrings@...ux-nfs.org,
linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [Keyrings] [PATCH 7/9] KEYS: Permit in-place link replacement
in keyring list
On Wed, 08 Feb 2012 11:04:00 +0000
David Howells <dhowells@...hat.com> wrote:
> @@ -154,11 +164,10 @@ static void keyring_destroy(struct key *keyring)
> write_unlock(&keyring_name_lock);
> }
>
> - klist = rcu_dereference_check(keyring->payload.subscriptions,
> - atomic_read(&keyring->usage) == 0);
> + klist = rcu_access_pointer(keyring->payload.subscriptions);
> if (klist) {
> for (loop = klist->nkeys - 1; loop >= 0; loop--)
> - key_put(klist->keys[loop]);
> + key_put(rcu_access_pointer(klist->keys[loop]));
> kfree(klist);
> }
> }
Why is it safe to use key_put(rcu_access_pointer(...)) ? Clearly that
pointer will end up being dereferenced, right?
--
Jeff Layton <jlayton@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists