aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/request_key_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/request_key_auth.c')
-rw-r--r--security/keys/request_key_auth.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c
index e356075ed2f8..6ebf1af8fce9 100644
--- a/security/keys/request_key_auth.c
+++ b/security/keys/request_key_auth.c
@@ -163,9 +163,10 @@ struct key *request_key_auth_new(struct key *target, const void *callout_info,
163 rka = kzalloc(sizeof(*rka), GFP_KERNEL); 163 rka = kzalloc(sizeof(*rka), GFP_KERNEL);
164 if (!rka) 164 if (!rka)
165 goto error; 165 goto error;
166 rka->callout_info = kmalloc(callout_len, GFP_KERNEL); 166 rka->callout_info = kmemdup(callout_info, callout_len, GFP_KERNEL);
167 if (!rka->callout_info) 167 if (!rka->callout_info)
168 goto error_free_rka; 168 goto error_free_rka;
169 rka->callout_len = callout_len;
169 170
170 /* see if the calling process is already servicing the key request of 171 /* see if the calling process is already servicing the key request of
171 * another process */ 172 * another process */
@@ -196,8 +197,6 @@ struct key *request_key_auth_new(struct key *target, const void *callout_info,
196 197
197 rka->target_key = key_get(target); 198 rka->target_key = key_get(target);
198 rka->dest_keyring = key_get(dest_keyring); 199 rka->dest_keyring = key_get(dest_keyring);
199 memcpy(rka->callout_info, callout_info, callout_len);
200 rka->callout_len = callout_len;
201 200
202 /* allocate the auth key */ 201 /* allocate the auth key */
203 sprintf(desc, "%x", target->serial); 202 sprintf(desc, "%x", target->serial);