提交 f6b24579 编写于 作者: M Mimi Zohar 提交者: James Morris

keys: fix user_defined key sparse messages

Replace the rcu_assign_pointer() calls with rcu_assign_keypointer().
Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
Signed-off-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJames Morris <jmorris@namei.org>
上级 3db59dd9
...@@ -59,7 +59,7 @@ int user_instantiate(struct key *key, const void *data, size_t datalen) ...@@ -59,7 +59,7 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
/* attach the data */ /* attach the data */
upayload->datalen = datalen; upayload->datalen = datalen;
memcpy(upayload->data, data, datalen); memcpy(upayload->data, data, datalen);
rcu_assign_pointer(key->payload.data, upayload); rcu_assign_keypointer(key, upayload);
ret = 0; ret = 0;
error: error:
...@@ -98,7 +98,7 @@ int user_update(struct key *key, const void *data, size_t datalen) ...@@ -98,7 +98,7 @@ int user_update(struct key *key, const void *data, size_t datalen)
if (ret == 0) { if (ret == 0) {
/* attach the new data, displacing the old */ /* attach the new data, displacing the old */
zap = key->payload.data; zap = key->payload.data;
rcu_assign_pointer(key->payload.data, upayload); rcu_assign_keypointer(key, upayload);
key->expiry = 0; key->expiry = 0;
} }
...@@ -133,7 +133,7 @@ void user_revoke(struct key *key) ...@@ -133,7 +133,7 @@ void user_revoke(struct key *key)
key_payload_reserve(key, 0); key_payload_reserve(key, 0);
if (upayload) { if (upayload) {
rcu_assign_pointer(key->payload.data, NULL); rcu_assign_keypointer(key, NULL);
kfree_rcu(upayload, rcu); kfree_rcu(upayload, rcu);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册