aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/request_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/request_key.c')
-rw-r--r--security/keys/request_key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index d31862e0aa1c..82465328c39b 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -71,9 +71,8 @@ EXPORT_SYMBOL(complete_request_key);
71 * This is called in context of freshly forked kthread before kernel_execve(), 71 * This is called in context of freshly forked kthread before kernel_execve(),
72 * so we can simply install the desired session_keyring at this point. 72 * so we can simply install the desired session_keyring at this point.
73 */ 73 */
74static int umh_keys_init(struct subprocess_info *info) 74static int umh_keys_init(struct subprocess_info *info, struct cred *cred)
75{ 75{
76 struct cred *cred = (struct cred*)current_cred();
77 struct key *keyring = info->data; 76 struct key *keyring = info->data;
78 77
79 return install_session_keyring_to_cred(cred, keyring); 78 return install_session_keyring_to_cred(cred, keyring);
@@ -470,7 +469,7 @@ static struct key *construct_key_and_link(struct key_type *type,
470 } else if (ret == -EINPROGRESS) { 469 } else if (ret == -EINPROGRESS) {
471 ret = 0; 470 ret = 0;
472 } else { 471 } else {
473 key = ERR_PTR(ret); 472 goto couldnt_alloc_key;
474 } 473 }
475 474
476 key_put(dest_keyring); 475 key_put(dest_keyring);
@@ -480,6 +479,7 @@ static struct key *construct_key_and_link(struct key_type *type,
480construction_failed: 479construction_failed:
481 key_negate_and_link(key, key_negative_timeout, NULL, NULL); 480 key_negate_and_link(key, key_negative_timeout, NULL, NULL);
482 key_put(key); 481 key_put(key);
482couldnt_alloc_key:
483 key_put(dest_keyring); 483 key_put(dest_keyring);
484 kleave(" = %d", ret); 484 kleave(" = %d", ret);
485 return ERR_PTR(ret); 485 return ERR_PTR(ret);