From: David Howells Date: Mon, 22 Aug 2011 13:08:51 +0000 (+0100) Subject: KEYS: __key_link() should use the RCU deref wrapper for keyring payloads X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d528b082294f0ddabd6368297546a2c0b67d4fe;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git KEYS: __key_link() should use the RCU deref wrapper for keyring payloads __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 Signed-off-by: James Morris --- diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 30e242f7bd0e..37a7f3b28852 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c @@ -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);