[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31577.1272978051@redhat.com>
Date: Tue, 04 May 2010 14:00:51 +0100
From: David Howells <dhowells@...hat.com>
To: "Serge E. Hallyn" <serue@...ibm.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc: dhowells@...hat.com, torvalds@...l.org, akpm@...ux-foundation.org,
keyrings@...ux-nfs.org, linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/7] KEYS: Use RCU dereference wrappers in keyring key type code
Serge E. Hallyn <serue@...ibm.com> wrote:
> <shrug> does this mean that the
> klist = rcu_dereference_check(keyring->payload.subscriptions,
> lockdep_is_held(&key_serial_lock));
> in security/keys/gc.c:key_gc_keyring() should become a
> rcu_dereference_protected() to avoid the rcu_dereference_raw() and for
> consistency?
Well spotted. That's incorrect modification by commit
e7b0a61b7929632d36cf052d9e2820ef0a9c1bfe.
key_serial_lock is not a guarantor of the current keyring subscriptions not
changing as we read it. We need to hold either the RCU read lock (so that the
what the pointer currently points to isn't trashed) or the keyring semaphore
(so that the keyring isn't changed under us).
The real error is not holding the RCU read lock (I'd assumed that the fact it
was holding a spinlock implied this - which I now know to be wrong).
David
--
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