Home
last modified time | relevance | path

Searched refs:rc (Results 1 – 25 of 32) sorted by relevance

12

/security/selinux/ss/
Dpolicydb.c178 int rc; in roles_init() local
181 rc = -ENOMEM; in roles_init()
186 rc = -EINVAL; in roles_init()
191 rc = -ENOMEM; in roles_init()
196 rc = hashtab_insert(p->p_roles.table, key, role); in roles_init()
197 if (rc) in roles_init()
204 return rc; in roles_init()
274 int i, rc; in policydb_init() local
279 rc = symtab_init(&p->symtab[i], symtab_sizes[i]); in policydb_init()
280 if (rc) in policydb_init()
[all …]
Dconditional.c121 int rc; in cond_policydb_init() local
126 rc = avtab_init(&p->te_cond_avtab); in cond_policydb_init()
127 if (rc) in cond_policydb_init()
128 return rc; in cond_policydb_init()
227 int rc; in cond_read_bool() local
233 rc = next_entry(buf, fp, sizeof buf); in cond_read_bool()
234 if (rc) in cond_read_bool()
240 rc = -EINVAL; in cond_read_bool()
246 rc = -ENOMEM; in cond_read_bool()
250 rc = next_entry(key, fp, len); in cond_read_bool()
[all …]
Dservices.c789 int rc = 0; in security_validate_transition() local
801 rc = -EINVAL; in security_validate_transition()
810 rc = -EINVAL; in security_validate_transition()
818 rc = -EINVAL; in security_validate_transition()
826 rc = -EINVAL; in security_validate_transition()
834 rc = security_validtrans_handle_fail(ocontext, ncontext, in security_validate_transition()
843 return rc; in security_validate_transition()
860 int rc; in security_bounded_transition() local
864 rc = -EINVAL; in security_bounded_transition()
872 rc = -EINVAL; in security_bounded_transition()
[all …]
Dcontext.h42 int rc; in mls_context_cpy() local
45 rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat); in mls_context_cpy()
46 if (rc) in mls_context_cpy()
50 rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[1].cat); in mls_context_cpy()
51 if (rc) in mls_context_cpy()
54 return rc; in mls_context_cpy()
62 int rc; in mls_context_cpy_low() local
65 rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat); in mls_context_cpy_low()
66 if (rc) in mls_context_cpy_low()
70 rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[0].cat); in mls_context_cpy_low()
[all …]
Davtab.c389 int i, rc; in avtab_read_item() local
396 rc = next_entry(buf32, fp, sizeof(u32)); in avtab_read_item()
397 if (rc) { in avtab_read_item()
399 return rc; in avtab_read_item()
407 rc = next_entry(buf32, fp, sizeof(u32)*items2); in avtab_read_item()
408 if (rc) { in avtab_read_item()
410 return rc; in avtab_read_item()
454 rc = insertf(a, &key, &datum, p); in avtab_read_item()
455 if (rc) in avtab_read_item()
456 return rc; in avtab_read_item()
[all …]
Dmls.c254 int l, rc = -EINVAL; in mls_context_to_sid() local
276 rc = mls_context_cpy(context, defcon); in mls_context_to_sid()
292 rc = -EINVAL; in mls_context_to_sid()
318 rc = -EINVAL; in mls_context_to_sid()
322 rc = ebitmap_set_bit(&context->range.level[l].cat, in mls_context_to_sid()
324 if (rc) in mls_context_to_sid()
333 rc = -EINVAL; in mls_context_to_sid()
338 rc = -EINVAL; in mls_context_to_sid()
343 rc = ebitmap_set_bit(&context->range.level[l].cat, i, 1); in mls_context_to_sid()
344 if (rc) in mls_context_to_sid()
[all …]
Debitmap.c356 int rc, i; in ebitmap_read() local
360 rc = next_entry(buf, fp, sizeof buf); in ebitmap_read()
361 if (rc < 0) in ebitmap_read()
385 rc = next_entry(&startbit, fp, sizeof(u32)); in ebitmap_read()
386 if (rc < 0) { in ebitmap_read()
411 rc = -ENOMEM; in ebitmap_read()
428 rc = next_entry(&map, fp, sizeof(u64)); in ebitmap_read()
429 if (rc < 0) { in ebitmap_read()
442 rc = 0; in ebitmap_read()
444 return rc; in ebitmap_read()
[all …]
Dsidtab.c35 int hvalue, rc = 0; in sidtab_insert() local
39 rc = -ENOMEM; in sidtab_insert()
52 rc = -EEXIST; in sidtab_insert()
58 rc = -ENOMEM; in sidtab_insert()
64 rc = -ENOMEM; in sidtab_insert()
82 return rc; in sidtab_insert()
131 int i, rc = 0; in sidtab_map() local
140 rc = apply(cur->sid, &cur->context, args); in sidtab_map()
141 if (rc) in sidtab_map()
147 return rc; in sidtab_map()
/security/integrity/ima/
Dima_crypto.c26 int rc; in init_desc() local
32 rc = PTR_ERR(desc->tfm); in init_desc()
33 return rc; in init_desc()
36 rc = crypto_hash_init(desc); in init_desc()
37 if (rc) in init_desc()
39 return rc; in init_desc()
51 int rc; in ima_calc_hash() local
53 rc = init_desc(&desc); in ima_calc_hash()
54 if (rc != 0) in ima_calc_hash()
55 return rc; in ima_calc_hash()
[all …]
Dima_main.c55 int rc; in ima_rdwr_violation_check() local
69 rc = ima_must_measure(inode, MAY_READ, FILE_CHECK); in ima_rdwr_violation_check()
70 if (rc < 0) in ima_rdwr_violation_check()
126 int rc = 0; in process_measurement() local
131 rc = ima_must_measure(inode, mask, function); in process_measurement()
132 if (rc != 0) in process_measurement()
133 return rc; in process_measurement()
137 rc = integrity_inode_alloc(inode); in process_measurement()
138 if (!rc || rc == -EEXIST) in process_measurement()
140 return rc; in process_measurement()
[all …]
Dima_init.c78 int rc; in ima_init() local
81 rc = tpm_pcr_read(TPM_ANY_NUM, 0, pcr_i); in ima_init()
82 if (rc == 0) in ima_init()
Dima_queue.c49 int rc; in ima_lookup_digest_entry() local
54 rc = memcmp(qe->entry->digest, digest_value, IMA_DIGEST_SIZE); in ima_lookup_digest_entry()
55 if (rc == 0) { in ima_lookup_digest_entry()
/security/selinux/
Dnetlabel.c60 int rc; in selinux_netlbl_sidlookup_cached() local
62 rc = security_netlbl_secattr_to_sid(secattr, sid); in selinux_netlbl_sidlookup_cached()
63 if (rc == 0 && in selinux_netlbl_sidlookup_cached()
68 return rc; in selinux_netlbl_sidlookup_cached()
83 int rc; in selinux_netlbl_sock_genattr() local
93 rc = security_netlbl_sid_to_secattr(sksec->sid, secattr); in selinux_netlbl_sock_genattr()
94 if (rc != 0) { in selinux_netlbl_sock_genattr()
180 int rc; in selinux_netlbl_skbuff_getsid() local
189 rc = netlbl_skbuff_getattr(skb, family, &secattr); in selinux_netlbl_skbuff_getsid()
190 if (rc == 0 && secattr.flags != NETLBL_SECATTR_NONE) in selinux_netlbl_skbuff_getsid()
[all …]
Dxfrm.c82 int rc; in selinux_xfrm_policy_lookup() local
99 rc = avc_has_perm(fl_secid, sel_sid, SECCLASS_ASSOCIATION, in selinux_xfrm_policy_lookup()
103 if (rc == -EACCES) in selinux_xfrm_policy_lookup()
106 return rc; in selinux_xfrm_policy_lookup()
118 int rc; in selinux_xfrm_state_pol_flow_match() local
141 rc = avc_has_perm(fl->flowi_secid, state_sid, SECCLASS_ASSOCIATION, in selinux_xfrm_state_pol_flow_match()
152 return rc; in selinux_xfrm_state_pol_flow_match()
200 int rc = 0; in selinux_xfrm_sec_ctx_alloc() local
233 rc = security_context_to_sid(ctx->ctx_str, in selinux_xfrm_sec_ctx_alloc()
237 if (rc) in selinux_xfrm_sec_ctx_alloc()
[all …]
Dhooks.c343 int rc; in may_context_mount_sb_relabel() local
345 rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_sb_relabel()
347 if (rc) in may_context_mount_sb_relabel()
348 return rc; in may_context_mount_sb_relabel()
350 rc = avc_has_perm(tsec->sid, sid, SECCLASS_FILESYSTEM, in may_context_mount_sb_relabel()
352 return rc; in may_context_mount_sb_relabel()
360 int rc; in may_context_mount_inode_relabel() local
361 rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_inode_relabel()
363 if (rc) in may_context_mount_inode_relabel()
364 return rc; in may_context_mount_inode_relabel()
[all …]
Davc.c153 int rc; in avc_dump_query() local
157 rc = security_sid_to_context(ssid, &scontext, &scontext_len); in avc_dump_query()
158 if (rc) in avc_dump_query()
165 rc = security_sid_to_context(tsid, &scontext, &scontext_len); in avc_dump_query()
166 if (rc) in avc_dump_query()
261 unsigned int rc = 0; in avc_xperms_has_perm() local
265 rc = security_xperm_test(xpd->allowed->p, perm); in avc_xperms_has_perm()
268 rc = security_xperm_test(xpd->auditallow->p, perm); in avc_xperms_has_perm()
271 rc = security_xperm_test(xpd->dontaudit->p, perm); in avc_xperms_has_perm()
272 return rc; in avc_xperms_has_perm()
[all …]
Dselinuxfs.c374 int rc; in sel_open_policy() local
380 rc = task_has_security(current, SECURITY__READ_POLICY); in sel_open_policy()
381 if (rc) in sel_open_policy()
384 rc = -EBUSY; in sel_open_policy()
388 rc = -ENOMEM; in sel_open_policy()
399 rc = security_read_policy(&plm->data, &plm->len); in sel_open_policy()
400 if (rc) in sel_open_policy()
416 return rc; in sel_open_policy()
913 int i, rc; in sel_write_user() local
945 rc = security_sid_to_context(sids[i], &newcon, &len); in sel_write_user()
[all …]
/security/yama/
Dyama_lsm.c46 int rc = 0; in yama_ptracer_add() local
71 return rc; in yama_ptracer_add()
117 int rc; in yama_task_prctl() local
120 rc = cap_task_prctl(option, arg2, arg3, arg4, arg5); in yama_task_prctl()
121 if (rc != -ENOSYS) in yama_task_prctl()
122 return rc; in yama_task_prctl()
140 rc = 0; in yama_task_prctl()
142 rc = yama_ptracer_add(NULL, myself); in yama_task_prctl()
151 rc = -EINVAL; in yama_task_prctl()
155 rc = yama_ptracer_add(tracer, myself); in yama_task_prctl()
[all …]
/security/smack/
Dsmack_lsm.c59 int rc; in smk_fetch() local
65 rc = ip->i_op->getxattr(dp, name, in, SMK_LABELLEN); in smk_fetch()
66 if (rc < 0) in smk_fetch()
69 return smk_import(in, rc); in smk_fetch()
127 int rc = 0; in smk_copy_rules() local
134 rc = -ENOMEM; in smk_copy_rules()
140 return rc; in smk_copy_rules()
159 int rc; in smack_ptrace_access_check() local
163 rc = cap_ptrace_access_check(ctp, mode); in smack_ptrace_access_check()
164 if (rc != 0) in smack_ptrace_access_check()
[all …]
Dsmackfs.c309 int rc = -EINVAL; in smk_write_load_list() local
329 rc = -EFAULT; in smk_write_load_list()
341 rc = -ENOMEM; in smk_write_load_list()
355 rc = count; in smk_write_load_list()
368 rc = -ENOMEM; in smk_write_load_list()
376 return rc; in smk_write_load_list()
523 int rc; in smk_cipso_doi() local
529 rc = netlbl_cfg_map_del(NULL, PF_INET, NULL, NULL, &nai); in smk_cipso_doi()
530 if (rc != 0) in smk_cipso_doi()
532 __func__, __LINE__, rc); in smk_cipso_doi()
[all …]
Dsmack_access.c129 int rc = 0; in smk_access() local
137 rc = -EACCES; in smk_access()
184 rc = -EACCES; in smk_access()
188 smack_log(subject_label, object_label, request, rc, a); in smk_access()
190 return rc; in smk_access()
209 int rc; in smk_curacc() local
214 rc = smk_access(sp, obj_label, mode, NULL); in smk_curacc()
215 if (rc == 0) { in smk_curacc()
225 rc = -EACCES; in smk_curacc()
237 rc = 0; in smk_curacc()
[all …]
/security/integrity/evm/
Devm_main.c95 int rc, xattr_len; in evm_verify_hmac() local
103 rc = vfs_getxattr_alloc(dentry, XATTR_NAME_EVM, (char **)&xattr_data, 0, in evm_verify_hmac()
105 if (rc <= 0) { in evm_verify_hmac()
106 if (rc == 0) in evm_verify_hmac()
108 else if (rc == -ENODATA) { in evm_verify_hmac()
109 rc = evm_find_protected_xattrs(dentry); in evm_verify_hmac()
110 if (rc > 0) in evm_verify_hmac()
112 else if (rc == 0) in evm_verify_hmac()
118 xattr_len = rc - 1; in evm_verify_hmac()
123 rc = evm_calc_hmac(dentry, xattr_name, xattr_value, in evm_verify_hmac()
[all …]
Devm_crypto.c35 long rc; in init_desc() local
54 rc = PTR_ERR(*tfm); in init_desc()
55 pr_err("Can not allocate %s (reason: %ld)\n", algo, rc); in init_desc()
58 return ERR_PTR(rc); in init_desc()
61 rc = crypto_shash_setkey(*tfm, evmkey, evmkey_len); in init_desc()
62 if (rc) { in init_desc()
66 return ERR_PTR(rc); in init_desc()
81 rc = crypto_shash_init(desc); in init_desc()
82 if (rc) { in init_desc()
84 return ERR_PTR(rc); in init_desc()
[all …]
Devm_secfs.c36 ssize_t rc; in evm_read_key() local
42 rc = simple_read_from_buffer(buf, count, ppos, temp, strlen(temp)); in evm_read_key()
44 return rc; in evm_read_key()
/security/
Dcommoncap.c437 int rc = 0; in get_file_caps() local
450 rc = get_vfs_caps_from_disk(dentry, &vcaps); in get_file_caps()
451 if (rc < 0) { in get_file_caps()
452 if (rc == -EINVAL) in get_file_caps()
454 __func__, rc, bprm->filename); in get_file_caps()
455 else if (rc == -ENODATA) in get_file_caps()
456 rc = 0; in get_file_caps()
460 rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_cap); in get_file_caps()
461 if (rc == -EINVAL) in get_file_caps()
463 __func__, rc, bprm->filename); in get_file_caps()
[all …]

12