Home
last modified time | relevance | path

Searched refs:ret (Results 1 – 25 of 50) sorted by relevance

12

/security/keys/trusted-keys/
Dtrusted_tpm1.c55 int ret; in TSS_sha1() local
63 ret = crypto_shash_digest(&sdesc->shash, data, datalen, digest); in TSS_sha1()
65 return ret; in TSS_sha1()
75 int ret; in TSS_rawhmac() local
83 ret = crypto_shash_setkey(hmacalg, key, keylen); in TSS_rawhmac()
84 if (ret < 0) in TSS_rawhmac()
86 ret = crypto_shash_init(&sdesc->shash); in TSS_rawhmac()
87 if (ret < 0) in TSS_rawhmac()
97 ret = -EINVAL; in TSS_rawhmac()
100 ret = crypto_shash_update(&sdesc->shash, data, dlen); in TSS_rawhmac()
[all …]
Dtrusted_core.c73 int ret = -EINVAL; in datablob_parse() local
88 ret = kstrtol(c, 10, &keylen); in datablob_parse()
89 if (ret < 0 || keylen < MIN_KEY_SIZE || keylen > MAX_KEY_SIZE) in datablob_parse()
92 ret = Opt_new; in datablob_parse()
102 ret = hex2bin(p->blob, c, p->blob_len); in datablob_parse()
103 if (ret < 0) in datablob_parse()
105 ret = Opt_load; in datablob_parse()
108 ret = Opt_update; in datablob_parse()
113 return ret; in datablob_parse()
119 int ret; in trusted_payload_alloc() local
[all …]
Dtrusted_tee.c65 int ret; in trusted_tee_seal() local
86 ret = PTR_ERR(reg_shm_out); in trusted_tee_seal()
103 ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); in trusted_tee_seal()
104 if ((ret < 0) || (inv_arg.ret != 0)) { in trusted_tee_seal()
106 inv_arg.ret); in trusted_tee_seal()
107 ret = -EFAULT; in trusted_tee_seal()
118 return ret; in trusted_tee_seal()
126 int ret; in trusted_tee_unseal() local
147 ret = PTR_ERR(reg_shm_out); in trusted_tee_unseal()
164 ret = tee_client_invoke_func(pvt_data.ctx, &inv_arg, param); in trusted_tee_unseal()
[all …]
/security/keys/
Dkeyctl.c49 int ret; in key_get_type_from_user() local
51 ret = strncpy_from_user(type, _type, len); in key_get_type_from_user()
52 if (ret < 0) in key_get_type_from_user()
53 return ret; in key_get_type_from_user()
54 if (ret == 0 || ret >= len) in key_get_type_from_user()
83 long ret; in SYSCALL_DEFINE5() local
85 ret = -EINVAL; in SYSCALL_DEFINE5()
90 ret = key_get_type_from_user(type, _type, sizeof(type)); in SYSCALL_DEFINE5()
91 if (ret < 0) in SYSCALL_DEFINE5()
98 ret = PTR_ERR(description); in SYSCALL_DEFINE5()
[all …]
Drequest_key.c128 int ret, i; in call_sbin_request_key() local
132 ret = look_up_user_keyrings(NULL, &user_session); in call_sbin_request_key()
133 if (ret < 0) in call_sbin_request_key()
145 ret = PTR_ERR(keyring); in call_sbin_request_key()
150 ret = key_link(keyring, authkey); in call_sbin_request_key()
151 if (ret < 0) in call_sbin_request_key()
196 ret = call_usermodehelper_keys(request_key, argv, envp, keyring, in call_sbin_request_key()
198 kdebug("usermode -> 0x%x", ret); in call_sbin_request_key()
199 if (ret >= 0) { in call_sbin_request_key()
203 ret = -ENOKEY; in call_sbin_request_key()
[all …]
Dkeyctl_pkey.c84 int ret; in keyctl_pkey_params_get() local
94 ret = keyctl_pkey_params_parse(params); in keyctl_pkey_params_get()
95 if (ret < 0) in keyctl_pkey_params_get()
96 return ret; in keyctl_pkey_params_get()
120 int ret; in keyctl_pkey_params_get_2() local
128 ret = keyctl_pkey_params_get(uparams.key_id, _info, params); in keyctl_pkey_params_get_2()
129 if (ret < 0) in keyctl_pkey_params_get_2()
130 return ret; in keyctl_pkey_params_get_2()
132 ret = params->key->type->asym_query(params, &info); in keyctl_pkey_params_get_2()
133 if (ret < 0) in keyctl_pkey_params_get_2()
[all …]
Dprocess_keys.c84 int ret; in look_up_user_keyrings() local
95 ret = 0; in look_up_user_keyrings()
112 ret = PTR_ERR(uid_keyring); in look_up_user_keyrings()
116 ret = PTR_ERR(uid_keyring_r); in look_up_user_keyrings()
134 ret = PTR_ERR(session_keyring); in look_up_user_keyrings()
141 ret = key_link(session_keyring, uid_keyring); in look_up_user_keyrings()
142 if (ret < 0) in look_up_user_keyrings()
148 ret = key_link(reg_keyring, session_keyring); in look_up_user_keyrings()
149 if (ret < 0) in look_up_user_keyrings()
152 ret = PTR_ERR(session_keyring_r); in look_up_user_keyrings()
[all …]
Ddh.c22 ssize_t ret; in dh_data_from_key() local
26 ret = -ENOKEY; in dh_data_from_key()
32 ret = -EOPNOTSUPP; in dh_data_from_key()
46 ret = payload->datalen; in dh_data_from_key()
48 ret = -ENOMEM; in dh_data_from_key()
56 return ret; in dh_data_from_key()
204 int ret; in keyctl_dh_compute_kdf() local
210 ret = -ENOMEM; in keyctl_dh_compute_kdf()
214 ret = kdf_ctr(sdesc, kbuf, kbuflen, outbuf, outbuf_len, lzero); in keyctl_dh_compute_kdf()
215 if (ret) in keyctl_dh_compute_kdf()
[all …]
Dkey.c233 int ret; in key_alloc() local
240 ret = type->vet_description(desc); in key_alloc()
241 if (ret < 0) { in key_alloc()
242 key = ERR_PTR(ret); in key_alloc()
315 ret = security_key_alloc(key, cred, flags); in key_alloc()
316 if (ret < 0) in key_alloc()
337 key = ERR_PTR(ret); in key_alloc()
376 int ret = 0; in key_payload_reserve() local
390 ret = -EDQUOT; in key_payload_reserve()
400 if (ret == 0) in key_payload_reserve()
[all …]
Dbig_key.c64 int ret; in big_key_preparse() local
91 ret = -ENOMEM; in big_key_preparse()
94 ret = get_random_bytes_wait(enckey, CHACHA20POLY1305_KEY_SIZE); in big_key_preparse()
95 if (unlikely(ret)) in big_key_preparse()
105 ret = PTR_ERR(file); in big_key_preparse()
111 ret = written; in big_key_preparse()
113 ret = -EIO; in big_key_preparse()
143 return ret; in big_key_preparse()
197 int ret; in big_key_update() local
199 ret = key_payload_reserve(key, prep->datalen); in big_key_update()
[all …]
Dkeyring.c485 long ret; in keyring_read() local
497 ret = assoc_array_iterate(&keyring->keys, in keyring_read()
499 if (ret < 0) { in keyring_read()
500 kleave(" = %ld [iterate]", ret); in keyring_read()
501 return ret; in keyring_read()
506 ret = keyring->keys.nr_leaves_on_tree * sizeof(key_serial_t); in keyring_read()
507 if (ret <= buflen) in keyring_read()
508 kleave("= %ld [ok]", ret); in keyring_read()
510 kleave("= %ld [buffer too small]", ret); in keyring_read()
511 return ret; in keyring_read()
[all …]
Dpersistent.c80 long ret; in key_get_persistent() local
111 ret = key_task_permission(persistent_ref, current_cred(), KEY_NEED_LINK); in key_get_persistent()
112 if (ret == 0) { in key_get_persistent()
114 ret = key_link(key_ref_to_ptr(dest_ref), persistent); in key_get_persistent()
115 if (ret == 0) { in key_get_persistent()
117 ret = persistent->serial; in key_get_persistent()
122 return ret; in key_get_persistent()
134 long ret; in keyctl_get_persistent() local
158 ret = -ENOTDIR; in keyctl_get_persistent()
162 ret = key_get_persistent(ns, uid, dest_ref); in keyctl_get_persistent()
[all …]
Duser_defined.c104 int ret; in user_update() local
107 ret = key_payload_reserve(key, prep->datalen); in user_update()
108 if (ret < 0) in user_update()
109 return ret; in user_update()
120 return ret; in user_update()
174 long ret; in user_read() local
177 ret = upayload->datalen; in user_read()
187 return ret; in user_read()
Drequest_key_auth.c87 long ret; in request_key_auth_read() local
93 ret = datalen; in request_key_auth_read()
103 return ret; in request_key_auth_read()
169 int ret = -ENOMEM; in request_key_auth_new() local
194 ret = -EKEYREVOKED; in request_key_auth_new()
221 ret = PTR_ERR(authkey); in request_key_auth_new()
226 ret = key_instantiate_and_link(authkey, rka, 0, NULL, NULL); in request_key_auth_new()
227 if (ret < 0) in request_key_auth_new()
238 kleave("= %d", ret); in request_key_auth_new()
239 return ERR_PTR(ret); in request_key_auth_new()
/security/keys/encrypted-keys/
Dencrypted.c176 int ret = -EINVAL; in datablob_parse() local
184 return ret; in datablob_parse()
192 return ret; in datablob_parse()
234 ret = 0; in datablob_parse()
247 ret = 0; in datablob_parse()
256 ret = 0; in datablob_parse()
264 return ret; in datablob_parse()
354 int ret; in get_derived_key() local
371 ret = crypto_shash_tfm_digest(hash_tfm, derived_buf, derived_buf_len, in get_derived_key()
374 return ret; in get_derived_key()
[all …]
/security/integrity/ima/
Dima_template.c324 int ret; in restore_template_fmt() local
326 ret = template_desc_init_fields(template_name, NULL, NULL); in restore_template_fmt()
327 if (ret < 0) { in restore_template_fmt()
358 int ret = 0; in ima_restore_template_data() local
375 ret = ima_parse_buf(template_data, template_data + template_data_size, in ima_restore_template_data()
379 if (ret < 0) { in ima_restore_template_data()
382 return ret; in ima_restore_template_data()
393 ret = -ENOMEM; in ima_restore_template_data()
401 if (ret < 0) { in ima_restore_template_data()
406 return ret; in ima_restore_template_data()
[all …]
Dima_kexec.c24 int ret = 0; in ima_dump_measurement_list() local
29 ret = -ENOMEM; in ima_dump_measurement_list()
44 ret = -EINVAL; in ima_dump_measurement_list()
49 if (ret < 0) in ima_dump_measurement_list()
71 if (ret == -EINVAL) in ima_dump_measurement_list()
73 return ret; in ima_dump_measurement_list()
93 int ret; in ima_add_kexec_buffer() local
121 ret = kexec_add_buffer(&kbuf); in ima_add_kexec_buffer()
122 if (ret) { in ima_add_kexec_buffer()
Dima_main.c504 int ret; in ima_bprm_check() local
508 ret = process_measurement(bprm->file, current_cred(), secid, NULL, 0, in ima_bprm_check()
510 if (ret) in ima_bprm_check()
511 return ret; in ima_bprm_check()
885 int ret = 0; in process_buffer_measurement() local
912 ret = -EINVAL; in process_buffer_measurement()
940 ret = ima_calc_buffer_hash(buf, size, iint.ima_hash); in process_buffer_measurement()
941 if (ret < 0) { in process_buffer_measurement()
949 ret = ima_calc_buffer_hash(digest_hash, digest_hash_len, in process_buffer_measurement()
951 if (ret < 0) { in process_buffer_measurement()
[all …]
/security/
Dsecurity.c236 int ret; in initialize_lsm() local
239 ret = lsm->init(); in initialize_lsm()
240 WARN(ret, "%s failed to initialize: %d\n", lsm->name, ret); in initialize_lsm()
866 int ret; in security_bprm_check() local
868 ret = call_int_hook(bprm_check_security, 0, bprm); in security_bprm_check()
869 if (ret) in security_bprm_check()
870 return ret; in security_bprm_check()
1093 int ret; in security_inode_init_security() local
1103 ret = call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, qstr, in security_inode_init_security()
1107 if (ret) in security_inode_init_security()
[all …]
Dcommoncap.c136 int ret = 0; in cap_ptrace_access_check() local
152 ret = -EPERM; in cap_ptrace_access_check()
155 return ret; in cap_ptrace_access_check()
173 int ret = 0; in cap_ptrace_traceme() local
184 ret = -EPERM; in cap_ptrace_traceme()
187 return ret; in cap_ptrace_traceme()
382 int size, ret; in cap_inode_getsecurity() local
400 ret = (int)vfs_getxattr_alloc(mnt_userns, dentry, XATTR_NAME_CAPS, in cap_inode_getsecurity()
404 if (ret < 0 || !tmpbuf) { in cap_inode_getsecurity()
405 size = ret; in cap_inode_getsecurity()
[all …]
/security/selinux/
Dselinuxfs.c466 int ret; in sel_read_policy() local
468 ret = avc_has_perm(&selinux_state, in sel_read_policy()
471 if (ret) in sel_read_policy()
472 return ret; in sel_read_policy()
542 int ret = 0; in sel_make_policy_nodes() local
556 ret = PTR_ERR(tmp_bool_dir); in sel_make_policy_nodes()
563 ret = PTR_ERR(tmp_class_dir); in sel_make_policy_nodes()
567 ret = sel_make_bools(newpolicy, tmp_bool_dir, &tmp_bool_num, in sel_make_policy_nodes()
569 if (ret) in sel_make_policy_nodes()
572 ret = sel_make_classes(newpolicy, tmp_class_dir, in sel_make_policy_nodes()
[all …]
Dnetnode.c191 int ret; in sel_netnode_sid_slow() local
206 ret = security_node_sid(&selinux_state, PF_INET, in sel_netnode_sid_slow()
212 ret = security_node_sid(&selinux_state, PF_INET6, in sel_netnode_sid_slow()
219 ret = -EINVAL; in sel_netnode_sid_slow()
221 if (ret == 0 && new) { in sel_netnode_sid_slow()
229 if (unlikely(ret)) in sel_netnode_sid_slow()
232 return ret; in sel_netnode_sid_slow()
/security/apparmor/
Dsecid.c127 int ret; in aa_alloc_secid() local
131 ret = idr_alloc(&aa_secids, label, AA_FIRST_SECID, 0, GFP_ATOMIC); in aa_alloc_secid()
135 if (ret < 0) { in aa_alloc_secid()
137 return ret; in aa_alloc_secid()
140 AA_BUG(ret == AA_SECID_INVALID); in aa_alloc_secid()
141 label->secid = ret; in aa_alloc_secid()
/security/safesetid/
Dsecurityfs.c35 int ret; in parse_policy_line() local
45 ret = kstrtou32(buf, 0, &parsed_parent); in parse_policy_line()
46 if (ret) in parse_policy_line()
47 return ret; in parse_policy_line()
49 ret = kstrtou32(child_str, 0, &parsed_child); in parse_policy_line()
50 if (ret) in parse_policy_line()
51 return ret; in parse_policy_line()
310 int ret; in safesetid_init_securityfs() local
320 ret = PTR_ERR(policy_dir); in safesetid_init_securityfs()
327 ret = PTR_ERR(uid_policy_file); in safesetid_init_securityfs()
[all …]
/security/integrity/
Ddigsig_asymmetric.c89 int ret; in asymmetric_verify() local
121 ret = -ENOPKG; in asymmetric_verify()
129 ret = verify_signature(key, &pks); in asymmetric_verify()
132 pr_debug("%s() = %d\n", __func__, ret); in asymmetric_verify()
133 return ret; in asymmetric_verify()

12