aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/encrypted-keys/encrypted.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/encrypted-keys/encrypted.c')
-rw-r--r--security/keys/encrypted-keys/encrypted.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/keys/encrypted-keys/encrypted.c b/security/keys/encrypted-keys/encrypted.c
index 41144f71d61..2d1bb8af769 100644
--- a/security/keys/encrypted-keys/encrypted.c
+++ b/security/keys/encrypted-keys/encrypted.c
@@ -314,7 +314,7 @@ static struct key *request_user_key(const char *master_desc, u8 **master_key,
314 goto error; 314 goto error;
315 315
316 down_read(&ukey->sem); 316 down_read(&ukey->sem);
317 upayload = rcu_dereference(ukey->payload.data); 317 upayload = ukey->payload.data;
318 *master_key = upayload->data; 318 *master_key = upayload->data;
319 *master_keylen = upayload->datalen; 319 *master_keylen = upayload->datalen;
320error: 320error:
@@ -810,7 +810,7 @@ static int encrypted_instantiate(struct key *key, const void *data,
810 goto out; 810 goto out;
811 } 811 }
812 812
813 rcu_assign_pointer(key->payload.data, epayload); 813 rcu_assign_keypointer(key, epayload);
814out: 814out:
815 kfree(datablob); 815 kfree(datablob);
816 return ret; 816 return ret;
@@ -874,7 +874,7 @@ static int encrypted_update(struct key *key, const void *data, size_t datalen)
874 memcpy(new_epayload->payload_data, epayload->payload_data, 874 memcpy(new_epayload->payload_data, epayload->payload_data,
875 epayload->payload_datalen); 875 epayload->payload_datalen);
876 876
877 rcu_assign_pointer(key->payload.data, new_epayload); 877 rcu_assign_keypointer(key, new_epayload);
878 call_rcu(&epayload->rcu, encrypted_rcu_free); 878 call_rcu(&epayload->rcu, encrypted_rcu_free);
879out: 879out:
880 kfree(buf); 880 kfree(buf);