Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182252
b: refs/heads/master
c: e7b0a61
h: refs/heads/master
v: v3
  • Loading branch information
Paul E. McKenney authored and Ingo Molnar committed Feb 25, 2010
1 parent ac9bbc0 commit 6e47896
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96be753af91fc9d582450a84722f6a6721d218ad
refs/heads/master: e7b0a61b7929632d36cf052d9e2820ef0a9c1bfe
3 changes: 2 additions & 1 deletion trunk/security/keys/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ static bool key_gc_keyring(struct key *keyring, time_t limit)
goto dont_gc;

/* scan the keyring looking for dead keys */
klist = rcu_dereference(keyring->payload.subscriptions);
klist = rcu_dereference_check(keyring->payload.subscriptions,
lockdep_is_held(&key_serial_lock));
if (!klist)
goto dont_gc;

Expand Down
4 changes: 3 additions & 1 deletion trunk/security/keys/keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 6e47896

Please sign in to comment.