Skip to content

Commit

Permalink
KEYS: __key_link() should use the RCU deref wrapper for keyring payloads
Browse files Browse the repository at this point in the history
__key_link() should use the RCU deref wrapper rcu_dereference_locked_keyring()
for accessing keyring payloads rather than calling rcu_dereference_protected()
directly.

Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
dhowells authored and James Morris committed Aug 22, 2011
1 parent 3ecf1b4 commit 6d528b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions security/keys/keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,7 @@ void __key_link(struct key *keyring, struct key *key,

kenter("%d,%d,%p", keyring->serial, key->serial, nklist);

klist = rcu_dereference_protected(keyring->payload.subscriptions,
rwsem_is_locked(&keyring->sem));
klist = rcu_dereference_locked_keyring(keyring);

atomic_inc(&key->usage);

Expand Down

0 comments on commit 6d528b0

Please sign in to comment.