aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/encrypted.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2011-03-07 10:05:51 -0500
committerJames Morris <jmorris@namei.org>2011-03-07 19:17:11 -0500
commit633e804e89464d3875e59de1959a53f9041d3094 (patch)
tree0a2464267c5f7a4e8166771fdc88e181a5b6219a /security/keys/encrypted.c
parent1cc26bada9f6807814806db2f0d78792eecdac71 (diff)
KEYS: Add an RCU payload dereference macro
Add an RCU payload dereference macro as this seems to be a common piece of code amongst key types that use RCU referenced payloads. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/keys/encrypted.c')
-rw-r--r--security/keys/encrypted.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/security/keys/encrypted.c b/security/keys/encrypted.c
index 9e7e4ce3fae8..69907a58a683 100644
--- a/security/keys/encrypted.c
+++ b/security/keys/encrypted.c
@@ -765,8 +765,7 @@ static long encrypted_read(const struct key *key, char __user *buffer,
765 size_t asciiblob_len; 765 size_t asciiblob_len;
766 int ret; 766 int ret;
767 767
768 epayload = rcu_dereference_protected(key->payload.data, 768 epayload = rcu_dereference_key(key);
769 rwsem_is_locked(&((struct key *)key)->sem));
770 769
771 /* returns the hex encoded iv, encrypted-data, and hmac as ascii */ 770 /* returns the hex encoded iv, encrypted-data, and hmac as ascii */
772 asciiblob_len = epayload->datablob_len + ivsize + 1 771 asciiblob_len = epayload->datablob_len + ivsize + 1