/security/selinux/ss/ |
D | policydb.c | 374 int rc; in roles_init() local 381 rc = -EINVAL; in roles_init() 386 rc = -ENOMEM; in roles_init() 391 rc = hashtab_insert(p->p_roles.table, key, role); in roles_init() 392 if (rc) in roles_init() 399 return rc; in roles_init() 470 int i, rc; in policydb_init() local 475 rc = symtab_init(&p->symtab[i], symtab_sizes[i]); in policydb_init() 476 if (rc) in policydb_init() 480 rc = avtab_init(&p->te_avtab); in policydb_init() [all …]
|
D | conditional.c | 119 int rc; in cond_policydb_init() local 124 rc = avtab_init(&p->te_cond_avtab); in cond_policydb_init() 125 if (rc) in cond_policydb_init() 126 return rc; in cond_policydb_init() 222 int rc; in cond_read_bool() local 228 rc = next_entry(buf, fp, sizeof buf); in cond_read_bool() 229 if (rc) in cond_read_bool() 235 rc = -EINVAL; in cond_read_bool() 243 rc = -ENOMEM; in cond_read_bool() 247 rc = next_entry(key, fp, len); in cond_read_bool() [all …]
|
D | services.c | 760 int rc = 0; in security_compute_validatetrans() local 777 rc = -EINVAL; in security_compute_validatetrans() 786 rc = -EINVAL; in security_compute_validatetrans() 794 rc = -EINVAL; in security_compute_validatetrans() 802 rc = -EINVAL; in security_compute_validatetrans() 811 rc = -EPERM; in security_compute_validatetrans() 813 rc = security_validtrans_handle_fail(state, in security_compute_validatetrans() 825 return rc; in security_compute_validatetrans() 861 int rc; in security_bounded_transition() local 871 rc = -EINVAL; in security_bounded_transition() [all …]
|
D | context.h | 44 int rc; in mls_context_cpy() local 47 rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat); in mls_context_cpy() 48 if (rc) in mls_context_cpy() 52 rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[1].cat); in mls_context_cpy() 53 if (rc) in mls_context_cpy() 56 return rc; in mls_context_cpy() 64 int rc; in mls_context_cpy_low() local 67 rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat); in mls_context_cpy_low() 68 if (rc) in mls_context_cpy_low() 72 rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[0].cat); in mls_context_cpy_low() [all …]
|
D | avtab.c | 399 int i, rc; in avtab_read_item() local 406 rc = next_entry(buf32, fp, sizeof(u32)); in avtab_read_item() 407 if (rc) { in avtab_read_item() 409 return rc; in avtab_read_item() 417 rc = next_entry(buf32, fp, sizeof(u32)*items2); in avtab_read_item() 418 if (rc) { in avtab_read_item() 420 return rc; in avtab_read_item() 464 rc = insertf(a, &key, &datum, p); in avtab_read_item() 465 if (rc) in avtab_read_item() 466 return rc; in avtab_read_item() [all …]
|
D | ebitmap.c | 98 int rc; in ebitmap_netlbl_export() local 114 rc = netlbl_catmap_setlong(catmap, in ebitmap_netlbl_export() 118 if (rc != 0) in ebitmap_netlbl_export() 146 int rc; in ebitmap_netlbl_import() local 153 rc = netlbl_catmap_getlong(catmap, &offset, &bitmap); in ebitmap_netlbl_import() 154 if (rc < 0) in ebitmap_netlbl_import() 354 int rc, i; in ebitmap_read() local 358 rc = next_entry(buf, fp, sizeof buf); in ebitmap_read() 359 if (rc < 0) in ebitmap_read() 386 rc = next_entry(&ebitmap_start, fp, sizeof(u32)); in ebitmap_read() [all …]
|
D | sidtab.c | 60 int rc; in sidtab_set_initial() local 67 rc = context_cpy(&entry->leaf.context, context); in sidtab_set_initial() 68 if (rc) in sidtab_set_initial() 69 return rc; in sidtab_set_initial() 244 int rc; in sidtab_context_to_sid() local 253 rc = 0; in sidtab_context_to_sid() 263 rc = -EOVERFLOW; in sidtab_context_to_sid() 268 rc = -ENOMEM; in sidtab_context_to_sid() 275 rc = context_cpy(&dst->context, context); in sidtab_context_to_sid() 276 if (rc) in sidtab_context_to_sid() [all …]
|
D | mls.c | 244 int l, rc, i; in mls_context_to_sid() local 319 rc = ebitmap_set_bit(&context->range.level[l].cat, in mls_context_to_sid() 321 if (rc) in mls_context_to_sid() 322 return rc; in mls_context_to_sid() 336 rc = ebitmap_set_bit(&context->range.level[l].cat, i, 1); in mls_context_to_sid() 337 if (rc) in mls_context_to_sid() 338 return rc; in mls_context_to_sid() 346 rc = ebitmap_cpy(&context->range.level[1].cat, in mls_context_to_sid() 348 if (rc) in mls_context_to_sid() 349 return rc; in mls_context_to_sid() [all …]
|
/security/integrity/ima/ |
D | ima_crypto.c | 64 long rc; in ima_init_crypto() local 68 rc = PTR_ERR(ima_shash_tfm); in ima_init_crypto() 70 hash_algo_name[ima_hash_algo], rc); in ima_init_crypto() 71 return rc; in ima_init_crypto() 81 int rc; in ima_alloc_tfm() local 89 rc = PTR_ERR(tfm); in ima_alloc_tfm() 91 hash_algo_name[algo], rc); in ima_alloc_tfm() 168 int rc; in ima_alloc_atfm() local 179 rc = PTR_ERR(tfm); in ima_alloc_atfm() 181 hash_algo_name[algo], rc); in ima_alloc_atfm() [all …]
|
D | ima_init.c | 105 int rc; in ima_init() local 111 rc = integrity_init_keyring(INTEGRITY_KEYRING_IMA); in ima_init() 112 if (rc) in ima_init() 113 return rc; in ima_init() 115 rc = ima_init_crypto(); in ima_init() 116 if (rc) in ima_init() 117 return rc; in ima_init() 118 rc = ima_init_template(); in ima_init() 119 if (rc != 0) in ima_init() 120 return rc; in ima_init() [all …]
|
D | ima_appraise.c | 63 int rc, offset; in ima_fix_xattr() local 74 rc = __vfs_setxattr_noperm(dentry, XATTR_NAME_IMA, in ima_fix_xattr() 78 return rc; in ima_fix_xattr() 213 int rc = -EINVAL, hash_start = 0; in xattr_verify() local 233 rc = memcmp(&xattr_value->data[hash_start], in xattr_verify() 237 rc = -EINVAL; in xattr_verify() 238 if (rc) { in xattr_verify() 247 rc = integrity_digsig_verify(INTEGRITY_KEYRING_IMA, in xattr_verify() 252 if (rc == -EOPNOTSUPP) { in xattr_verify() 256 if (IS_ENABLED(CONFIG_INTEGRITY_PLATFORM_KEYRING) && rc && in xattr_verify() [all …]
|
D | ima_modsig.c | 68 int rc; in ima_read_modsig() local 80 rc = mod_check_sig(sig, buf_len, func_tokens[func]); in ima_read_modsig() 81 if (rc) in ima_read_modsig() 82 return rc; in ima_read_modsig() 94 rc = PTR_ERR(hdr->pkcs7_msg); in ima_read_modsig() 96 return rc; in ima_read_modsig() 119 int rc; in ima_collect_modsig() local 127 rc = pkcs7_supply_detached_data(modsig->pkcs7_msg, buf, size); in ima_collect_modsig() 128 if (rc) in ima_collect_modsig() 132 rc = pkcs7_get_digest(modsig->pkcs7_msg, &modsig->digest, in ima_collect_modsig()
|
D | ima_main.c | 81 int rc = 0; in mmap_violation_check() local 84 rc = -ETXTBSY; in mmap_violation_check() 91 "mmap_file", "mmapped_writers", rc, 0); in mmap_violation_check() 93 return rc; in mmap_violation_check() 202 int rc = 0, action, must_appraise = 0; in process_measurement() local 235 rc = -ENOMEM; in process_measurement() 238 if (!rc && violation_check) in process_measurement() 244 if (rc) in process_measurement() 297 rc = mmap_violation_check(func, file, &pathbuf, in process_measurement() 299 if (!rc) in process_measurement() [all …]
|
/security/selinux/ |
D | netlabel.c | 46 int rc; in selinux_netlbl_sidlookup_cached() local 48 rc = security_netlbl_secattr_to_sid(&selinux_state, secattr, sid); in selinux_netlbl_sidlookup_cached() 49 if (rc == 0 && in selinux_netlbl_sidlookup_cached() 54 return rc; in selinux_netlbl_sidlookup_cached() 69 int rc; in selinux_netlbl_sock_genattr() local 79 rc = security_netlbl_sid_to_secattr(&selinux_state, sksec->sid, in selinux_netlbl_sock_genattr() 81 if (rc != 0) { in selinux_netlbl_sock_genattr() 193 int rc; in selinux_netlbl_skbuff_getsid() local 202 rc = netlbl_skbuff_getattr(skb, family, &secattr); in selinux_netlbl_skbuff_getsid() 203 if (rc == 0 && secattr.flags != NETLBL_SECATTR_NONE) in selinux_netlbl_skbuff_getsid() [all …]
|
D | hooks.c | 464 int rc; in may_context_mount_sb_relabel() local 466 rc = avc_has_perm(&selinux_state, in may_context_mount_sb_relabel() 469 if (rc) in may_context_mount_sb_relabel() 470 return rc; in may_context_mount_sb_relabel() 472 rc = avc_has_perm(&selinux_state, in may_context_mount_sb_relabel() 475 return rc; in may_context_mount_sb_relabel() 483 int rc; in may_context_mount_inode_relabel() local 484 rc = avc_has_perm(&selinux_state, in may_context_mount_inode_relabel() 487 if (rc) in may_context_mount_inode_relabel() 488 return rc; in may_context_mount_inode_relabel() [all …]
|
D | xfrm.c | 78 int rc; in selinux_xfrm_alloc_user() local 101 rc = security_context_to_sid(&selinux_state, ctx->ctx_str, str_len, in selinux_xfrm_alloc_user() 103 if (rc) in selinux_xfrm_alloc_user() 106 rc = avc_has_perm(&selinux_state, in selinux_xfrm_alloc_user() 109 if (rc) in selinux_xfrm_alloc_user() 118 return rc; in selinux_xfrm_alloc_user() 155 int rc; in selinux_xfrm_policy_lookup() local 166 rc = avc_has_perm(&selinux_state, in selinux_xfrm_policy_lookup() 169 return (rc == -EACCES ? -ESRCH : rc); in selinux_xfrm_policy_lookup() 272 int rc; in selinux_xfrm_skb_sid() local [all …]
|
/security/smack/ |
D | smack_lsm.c | 121 struct smack_known *oskp, int mode, int rc) in smk_bu_note() argument 125 if (rc <= 0) in smk_bu_note() 126 return rc; in smk_bu_note() 127 if (rc > SMACK_UNCONFINED_OBJECT) in smk_bu_note() 128 rc = 0; in smk_bu_note() 131 pr_info("Smack %s: (%s %s %s) %s\n", smk_bu_mess[rc], in smk_bu_note() 141 int mode, int rc) in smk_bu_current() argument 146 if (rc <= 0) in smk_bu_current() 147 return rc; in smk_bu_current() 148 if (rc > SMACK_UNCONFINED_OBJECT) in smk_bu_current() [all …]
|
D | smackfs.c | 217 int rc = 0; in smk_set_access() local 238 rc = -ENOMEM; in smk_set_access() 251 return rc; in smk_set_access() 370 int rc; in smk_parse_rule() local 372 rc = smk_fill_rule(data, data + SMK_LABELLEN, in smk_parse_rule() 375 return rc; in smk_parse_rule() 392 int rc; in smk_parse_long_rule() local 417 rc = smk_fill_rule(tok[0], tok[1], tok[2], tok[3], rule, import, 0); in smk_parse_long_rule() 418 return rc == 0 ? cnt : rc; in smk_parse_long_rule() 450 int rc; in smk_write_rules_list() local [all …]
|
D | smack_access.c | 120 int rc = 0; in smk_access() local 129 rc = -EACCES; in smk_access() 174 rc = -EACCES; in smk_access() 184 rc = SMACK_BRINGUP_ALLOW; in smk_access() 190 if (rc < 0) { in smk_access() 192 rc = SMACK_UNCONFINED_OBJECT; in smk_access() 194 rc = SMACK_UNCONFINED_SUBJECT; in smk_access() 201 request, rc, a); in smk_access() 204 return rc; in smk_access() 224 int rc; in smk_tskacc() local [all …]
|
/security/integrity/evm/ |
D | evm_crypto.c | 54 int rc; in evm_set_key() local 56 rc = -EBUSY; in evm_set_key() 59 rc = -EINVAL; in evm_set_key() 70 return rc; in evm_set_key() 76 long rc; in init_desc() local 102 rc = PTR_ERR(*tfm); in init_desc() 103 pr_err("Can not allocate %s (reason: %ld)\n", algo, rc); in init_desc() 106 return ERR_PTR(rc); in init_desc() 109 rc = crypto_shash_setkey(*tfm, evmkey, evmkey_len); in init_desc() 110 if (rc) { in init_desc() [all …]
|
D | evm_main.c | 140 int rc, xattr_len; in evm_verify_hmac() local 149 rc = vfs_getxattr_alloc(dentry, XATTR_NAME_EVM, (char **)&xattr_data, 0, in evm_verify_hmac() 151 if (rc <= 0) { in evm_verify_hmac() 153 if (rc == -ENODATA) { in evm_verify_hmac() 154 rc = evm_find_protected_xattrs(dentry); in evm_verify_hmac() 155 if (rc > 0) in evm_verify_hmac() 157 else if (rc == 0) in evm_verify_hmac() 159 } else if (rc == -EOPNOTSUPP) { in evm_verify_hmac() 165 xattr_len = rc; in evm_verify_hmac() 176 rc = evm_calc_hmac(dentry, xattr_name, xattr_value, in evm_verify_hmac() [all …]
|
/security/yama/ |
D | yama_lsm.c | 224 int rc = -ENOSYS; in yama_task_prctl() local 243 rc = 0; in yama_task_prctl() 245 rc = yama_ptracer_add(NULL, myself); in yama_task_prctl() 251 rc = -EINVAL; in yama_task_prctl() 253 rc = yama_ptracer_add(tracer, myself); in yama_task_prctl() 262 return rc; in yama_task_prctl() 275 int rc = 0; in task_is_descendant() local 288 rc = 1; in task_is_descendant() 295 return rc; in task_is_descendant() 308 int rc = 0; in ptracer_exception_found() local [all …]
|
/security/integrity/platform_certs/ |
D | platform_keyring.c | 30 int rc; in add_to_platform_keyring() local 34 rc = integrity_load_cert(INTEGRITY_KEYRING_PLATFORM, source, data, len, in add_to_platform_keyring() 36 if (rc) in add_to_platform_keyring() 45 int rc; in platform_keyring_init() local 47 rc = integrity_init_keyring(INTEGRITY_KEYRING_PLATFORM); in platform_keyring_init() 48 if (rc) in platform_keyring_init() 49 return rc; in platform_keyring_init()
|
D | load_uefi.c | 147 int rc = 0; in load_uefi_certs() local 160 rc = parse_efi_signature_list("UEFI:db", in load_uefi_certs() 162 if (rc) in load_uefi_certs() 164 rc); in load_uefi_certs() 173 rc = parse_efi_signature_list("UEFI:MokListRT", in load_uefi_certs() 175 if (rc) in load_uefi_certs() 176 pr_err("Couldn't parse MokListRT signatures: %d\n", rc); in load_uefi_certs() 184 rc = parse_efi_signature_list("UEFI:dbx", in load_uefi_certs() 187 if (rc) in load_uefi_certs() 188 pr_err("Couldn't parse dbx signatures: %d\n", rc); in load_uefi_certs() [all …]
|
/security/integrity/ |
D | digsig.c | 151 int rc = 0; in integrity_add_key() local 160 rc = PTR_ERR(key); in integrity_add_key() 161 pr_err("Problem loading X.509 certificate %d\n", rc); in integrity_add_key() 168 return rc; in integrity_add_key() 176 int rc; in integrity_load_x509() local 179 rc = kernel_read_file_from_path(path, &data, &size, 0, in integrity_load_x509() 181 if (rc < 0) { in integrity_load_x509() 182 pr_err("Unable to open file: %s (%d)", path, rc); in integrity_load_x509() 183 return rc; in integrity_load_x509() 189 rc = integrity_add_key(id, (const void *)data, size, perm); in integrity_load_x509() [all …]
|