summaryrefslogtreecommitdiffstats
path: root/security/keys/keyring.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-03-09 23:22:08 +0100
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-03-09 23:22:08 +0100
commite739cf1da48e841bc5d744a99764c1a668b4bdd2 (patch)
tree1d39318bbbcdd66ad8cd34823ad9befb7af08b1f /security/keys/keyring.c
parentnfsd4: document lease/grace-period limits (diff)
parentLinux 2.6.34-rc1 (diff)
downloadlinux-e739cf1da48e841bc5d744a99764c1a668b4bdd2.tar.xz
linux-e739cf1da48e841bc5d744a99764c1a668b4bdd2.zip
Merge commit 'v2.6.34-rc1' into for-2.6.35-incoming
Diffstat (limited to 'security/keys/keyring.c')
-rw-r--r--security/keys/keyring.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index 8ec02746ca99..e814d2109f8e 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -151,7 +151,9 @@ static void keyring_destroy(struct key *keyring)
write_unlock(&keyring_name_lock);
}
- klist = rcu_dereference(keyring->payload.subscriptions);
+ klist = rcu_dereference_check(keyring->payload.subscriptions,
+ rcu_read_lock_held() ||
+ atomic_read(&keyring->usage) == 0);
if (klist) {
for (loop = klist->nkeys - 1; loop >= 0; loop--)
key_put(klist->keys[loop]);