/security/integrity/ima/ |
D | ima_template.c | 70 int i; in ima_template_has_modsig() local 72 for (i = 0; i < ima_template->num_fields; i++) in ima_template_has_modsig() 73 if (!strcmp(ima_template->fields[i]->field_id, "modsig") || in ima_template_has_modsig() 74 !strcmp(ima_template->fields[i]->field_id, "d-modsig")) in ima_template_has_modsig() 156 int i; in lookup_template_field() local 158 for (i = 0; i < ARRAY_SIZE(supported_fields); i++) in lookup_template_field() 159 if (strncmp(supported_fields[i].field_id, field_id, in lookup_template_field() 161 return &supported_fields[i]; in lookup_template_field() 169 int i = 0, j = 0; in template_fmt_size() local 171 while (i < template_fmt_len) { in template_fmt_size() [all …]
|
D | ima_policy.c | 254 int i; in ima_lsm_free_rule() local 256 for (i = 0; i < MAX_LSM_RULES; i++) { in ima_lsm_free_rule() 257 kfree(entry->lsm[i].rule); in ima_lsm_free_rule() 258 kfree(entry->lsm[i].args_p); in ima_lsm_free_rule() 266 int i, result; in ima_lsm_copy_rule() local 279 for (i = 0; i < MAX_LSM_RULES; i++) { in ima_lsm_copy_rule() 280 if (!entry->lsm[i].rule) in ima_lsm_copy_rule() 283 nentry->lsm[i].type = entry->lsm[i].type; in ima_lsm_copy_rule() 284 nentry->lsm[i].args_p = kstrdup(entry->lsm[i].args_p, in ima_lsm_copy_rule() 286 if (!nentry->lsm[i].args_p) in ima_lsm_copy_rule() [all …]
|
D | ima_api.c | 25 int i; in ima_free_template_entry() local 27 for (i = 0; i < entry->template_desc->num_fields; i++) in ima_free_template_entry() 28 kfree(entry->template_data[i].data); in ima_free_template_entry() 41 int i, result = 0; in ima_alloc_init_template() local 54 for (i = 0; i < template_desc->num_fields; i++) { in ima_alloc_init_template() 56 template_desc->fields[i]; in ima_alloc_init_template() 60 &((*entry)->template_data[i])); in ima_alloc_init_template() 64 len = (*entry)->template_data[i].len; in ima_alloc_init_template() 343 int i; in ima_audit_measurement() local 352 for (i = 0; i < iint->ima_hash->length; i++) in ima_audit_measurement() [all …]
|
D | ima_queue.c | 142 int i; in ima_pcr_extend() local 147 for (i = 0; i < ima_tpm_chip->nr_allocated_banks; i++) in ima_pcr_extend() 148 memcpy(digests[i].digest, hash, TPM_DIGEST_SIZE); in ima_pcr_extend() 220 int i; in ima_init_digests() local 230 for (i = 0; i < ima_tpm_chip->nr_allocated_banks; i++) in ima_init_digests() 231 digests[i].alg_id = ima_tpm_chip->allocated_banks[i].alg_id; in ima_init_digests()
|
D | ima_fs.c | 136 int i; in ima_measurements_show() local 176 for (i = 0; i < e->template_desc->num_fields; i++) { in ima_measurements_show() 179 e->template_desc->fields[i]; in ima_measurements_show() 185 field->field_show(m, show, &e->template_data[i]); in ima_measurements_show() 211 u32 i; in ima_print_digest() local 213 for (i = 0; i < size; i++) in ima_print_digest() 214 seq_printf(m, "%02x", *(digest + i)); in ima_print_digest() 224 int i; in ima_ascii_measurements_show() local 244 for (i = 0; i < e->template_desc->num_fields; i++) { in ima_ascii_measurements_show() 246 if (e->template_data[i].len == 0) in ima_ascii_measurements_show() [all …]
|
/security/selinux/ss/ |
D | sidtab.c | 25 u32 i; in sidtab_init() local 29 for (i = 0; i < SECINITSID_NUM; i++) in sidtab_init() 30 s->isids[i].set = 0; in sidtab_init() 89 int i; in sidtab_hash_stats() local 98 hash_for_each_rcu(sidtab->context_to_sid, i, entry, list) { in sidtab_hash_stats() 100 if (i == cur_bucket) { in sidtab_hash_stats() 105 cur_bucket = i; in sidtab_hash_stats() 323 u32 i; in sidtab_convert_hashtable() local 325 for (i = 0; i < count; i++) { in sidtab_convert_hashtable() 326 entry = sidtab_do_lookup(s, i, 0); in sidtab_convert_hashtable() [all …]
|
D | hashtab.c | 20 u32 i; in hashtab_create() local 36 for (i = 0; i < size; i++) in hashtab_create() 37 p->htable[i] = NULL; in hashtab_create() 101 u32 i; in hashtab_destroy() local 107 for (i = 0; i < h->size; i++) { in hashtab_destroy() 108 cur = h->htable[i]; in hashtab_destroy() 114 h->htable[i] = NULL; in hashtab_destroy() 127 u32 i; in hashtab_map() local 134 for (i = 0; i < h->size; i++) { in hashtab_map() 135 cur = h->htable[i]; in hashtab_map() [all …]
|
D | avtab.c | 279 int i; in avtab_destroy() local 285 for (i = 0; i < h->nslot; i++) { in avtab_destroy() 286 cur = h->htable[i]; in avtab_destroy() 346 int i, chain_len, slots_used, max_chain_len; in avtab_hash_eval() local 353 for (i = 0; i < h->nslot; i++) { in avtab_hash_eval() 354 cur = h->htable[i]; in avtab_hash_eval() 399 int i, rc; in avtab_read_item() local 460 for (i = 0; i < ARRAY_SIZE(spec_order); i++) { in avtab_read_item() 461 if (val & spec_order[i]) { in avtab_read_item() 462 key.specified = spec_order[i] | enabled; in avtab_read_item() [all …]
|
D | services.c | 105 u16 i, j; in selinux_set_mapping() local 112 i = 0; in selinux_set_mapping() 113 while (map[i].name) in selinux_set_mapping() 114 i++; in selinux_set_mapping() 117 out_map->mapping = kcalloc(++i, sizeof(*out_map->mapping), GFP_ATOMIC); in selinux_set_mapping() 170 out_map->size = i; in selinux_set_mapping() 195 u16 i; in map_class() local 197 for (i = 1; i < map->size; i++) { in map_class() 198 if (map->mapping[i].value == pol_value) in map_class() 199 return i; in map_class() [all …]
|
D | policydb.c | 167 int i; in policydb_lookup_compat() local 170 for (i = 0; i < ARRAY_SIZE(policydb_compat); i++) { in policydb_lookup_compat() 171 if (policydb_compat[i].version == version) { in policydb_lookup_compat() 172 info = &policydb_compat[i]; in policydb_lookup_compat() 355 static void ocontext_destroy(struct ocontext *c, int i) in ocontext_destroy() argument 362 if (i == OCON_ISID || i == OCON_FS || in ocontext_destroy() 363 i == OCON_NETIF || i == OCON_FSUSE) in ocontext_destroy() 470 int i, rc; in policydb_init() local 474 for (i = 0; i < SYM_NUM; i++) { in policydb_init() 475 rc = symtab_init(&p->symtab[i], symtab_sizes[i]); in policydb_init() [all …]
|
D | mls.c | 38 int i, l, len, head, prev; in mls_compute_context_len() local 55 ebitmap_for_each_positive_bit(e, node, i) { in mls_compute_context_len() 56 if (i - prev > 1) { in mls_compute_context_len() 62 nm = sym_name(p, SYM_CATS, i); in mls_compute_context_len() 64 head = i; in mls_compute_context_len() 66 prev = i; in mls_compute_context_len() 94 int i, l, head, prev; in mls_sid_to_context() local 115 ebitmap_for_each_positive_bit(e, node, i) { in mls_sid_to_context() 116 if (i - prev > 1) { in mls_sid_to_context() 131 nm = sym_name(p, SYM_CATS, i); in mls_sid_to_context() [all …]
|
D | ebitmap.c | 204 int i; in ebitmap_contains() local 217 for (i = EBITMAP_UNIT_NUMS - 1; (i >= 0) && !n2->maps[i]; ) in ebitmap_contains() 218 i--; /* Skip trailing NULL map entries */ in ebitmap_contains() 219 if (last_e2bit && (i >= 0)) { in ebitmap_contains() 220 u32 lastsetbit = n2->startbit + i * EBITMAP_UNIT_SIZE + in ebitmap_contains() 221 __fls(n2->maps[i]); in ebitmap_contains() 226 while (i >= 0) { in ebitmap_contains() 227 if ((n1->maps[i] & n2->maps[i]) != n2->maps[i]) in ebitmap_contains() 229 i--; in ebitmap_contains() 354 int rc, i; in ebitmap_read() local [all …]
|
/security/apparmor/include/ |
D | label.h | 31 typeof(N) i; \ 33 for (i = 0; i < (N); i++) \ 34 (V)[i] = NULL; \ 42 int i; \ 43 for (i = 0; i < (N); i++) { \ 44 if (!IS_ERR_OR_NULL((V)[i])) \ 45 aa_put_ ## T((V)[i]); \ 111 int i, j; member 154 int aa_label_next_confined(struct aa_label *l, int i); 158 for ((I).i = 0; ((P) = (L)->vec[(I).i]); ++((I).i)) [all …]
|
/security/apparmor/ |
D | label.c | 167 int i; in vec_cmp() local 176 for (i = 0; i < an && i < bn; i++) { in vec_cmp() 177 int res = profile_cmp(a[i], b[i]); in vec_cmp() 188 int i; in vec_is_stale() local 192 for (i = 0; i < n; i++) { in vec_is_stale() 193 if (profile_is_stale(vec[i])) in vec_is_stale() 202 int i; in vec_unconfined() local 206 for (i = 0; i < n; i++) { in vec_unconfined() 207 if (!profile_unconfined(vec[i])) in vec_unconfined() 226 int i, pos, dups = 0; in unique() local [all …]
|
D | match.c | 196 size_t i, state_count, trans_count; in verify_dfa() local 201 for (i = 0; i < state_count; i++) { in verify_dfa() 202 if (!(BASE_TABLE(dfa)[i] & MATCH_FLAG_DIFF_ENCODE) && in verify_dfa() 203 (DEFAULT_TABLE(dfa)[i] >= state_count)) in verify_dfa() 205 if (base_idx(BASE_TABLE(dfa)[i]) + 255 >= trans_count) { in verify_dfa() 211 for (i = 0; i < trans_count; i++) { in verify_dfa() 212 if (NEXT_TABLE(dfa)[i] >= state_count) in verify_dfa() 214 if (CHECK_TABLE(dfa)[i] >= state_count) in verify_dfa() 219 for (i = 0; i < state_count; i++) { in verify_dfa() 222 for (j = i; in verify_dfa() [all …]
|
D | policy_unpack.c | 480 int i, size; in unpack_trans_table() local 492 for (i = 0; i < size; i++) { in unpack_trans_table() 500 profile->file.trans.table[i] = str; in unpack_trans_table() 548 int i, size; in unpack_xattrs() local 555 for (i = 0; i < size; i++) { in unpack_xattrs() 556 if (!unpack_strdup(e, &profile->xattrs[i], NULL)) in unpack_xattrs() 575 int i, size; in unpack_secmark() local 587 for (i = 0; i < size; i++) { in unpack_secmark() 588 if (!unpack_u8(e, &profile->secmark[i].audit, NULL)) in unpack_secmark() 590 if (!unpack_u8(e, &profile->secmark[i].deny, NULL)) in unpack_secmark() [all …]
|
/security/tomoyo/ |
D | gc.c | 79 int i; in tomoyo_name_used_by_io_buffer() local 84 for (i = 0; i < TOMOYO_MAX_IO_READ_QUEUE; i++) { in tomoyo_name_used_by_io_buffer() 85 const char *w = head->r.w[i]; in tomoyo_name_used_by_io_buffer() 286 unsigned int i; in tomoyo_del_condition() local 298 for (i = 0; i < numbers_count; i++) in tomoyo_del_condition() 300 for (i = 0; i < names_count; i++) in tomoyo_del_condition() 302 for (i = 0; i < argc; argv++, i++) in tomoyo_del_condition() 304 for (i = 0; i < envc; envp++, i++) { in tomoyo_del_condition() 526 int i; in tomoyo_collect_entry() local 546 for (i = 0; i < TOMOYO_MAX_ACL_GROUPS; i++) in tomoyo_collect_entry() [all …]
|
D | common.c | 434 int i; in tomoyo_print_number_union_nospace() local 442 for (i = 0; i < 2; i++) { in tomoyo_print_number_union_nospace() 576 static void tomoyo_set_uint(unsigned int *i, const char *string, in tomoyo_set_uint() argument 582 sscanf(cp + strlen(find), "=%u", i); in tomoyo_set_uint() 597 u8 i; in tomoyo_set_mode() local 601 i = TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX; in tomoyo_set_mode() 605 for (i = 0; i < TOMOYO_MAX_MAC_INDEX in tomoyo_set_mode() 606 + TOMOYO_MAX_MAC_CATEGORY_INDEX; i++) { in tomoyo_set_mode() 609 if (i < TOMOYO_MAX_MAC_INDEX) { in tomoyo_set_mode() 610 const u8 c = tomoyo_index2category[i]; in tomoyo_set_mode() [all …]
|
D | condition.c | 29 int i; in tomoyo_argv() local 33 for (i = 0; i < argc; argv++, checked++, i++) { in tomoyo_argv() 64 int i; in tomoyo_envp() local 72 for (i = 0; i < envc; envp++, checked++, i++) { in tomoyo_envp() 191 int i; in tomoyo_scan_bprm() local 194 for (i = 0; i < argc; i++) { in tomoyo_scan_bprm() 195 if (checked[i]) in tomoyo_scan_bprm() 201 if (argv[i].is_not) in tomoyo_scan_bprm() 206 for (i = 0; i < envc; envp++, i++) { in tomoyo_scan_bprm() 207 if (checked[argc + i]) in tomoyo_scan_bprm() [all …]
|
/security/smack/ |
D | smack_access.c | 289 int i = 0; in smack_str_from_perm() local 292 string[i++] = 'r'; in smack_str_from_perm() 294 string[i++] = 'w'; in smack_str_from_perm() 296 string[i++] = 'x'; in smack_str_from_perm() 298 string[i++] = 'a'; in smack_str_from_perm() 300 string[i++] = 't'; in smack_str_from_perm() 302 string[i++] = 'l'; in smack_str_from_perm() 303 string[i] = '\0'; in smack_str_from_perm() 447 int i; in smk_parse_smack() local 460 for (i = 0; i < len; i++) in smk_parse_smack() [all …]
|
D | smackfs.c | 393 int i; in smk_parse_long_rule() local 398 for (i = 0; i < tokens; ++i) { in smk_parse_long_rule() 406 tok[i] = data + cnt; in smk_parse_long_rule() 414 while (i < 4) in smk_parse_long_rule() 415 tok[i++] = NULL; in smk_parse_long_rule() 535 int i = *pos; in smk_seq_start() local 541 if (i-- == 0) in smk_seq_start() 774 int i; in cipso_seq_show() local 789 for (i = netlbl_catmap_walk(cmp, 0); i >= 0; in cipso_seq_show() 790 i = netlbl_catmap_walk(cmp, i + 1)) { in cipso_seq_show() [all …]
|
/security/lockdown/ |
D | lockdown.c | 119 int i, offset = 0; in lockdown_read() local 121 for (i = 0; i < ARRAY_SIZE(lockdown_levels); i++) { in lockdown_read() 122 enum lockdown_reason level = lockdown_levels[i]; in lockdown_read() 145 int i, len, err = -EINVAL; in lockdown_write() local 157 for (i = 0; i < ARRAY_SIZE(lockdown_levels); i++) { in lockdown_write() 158 enum lockdown_reason level = lockdown_levels[i]; in lockdown_write()
|
/security/selinux/ |
D | nlmsgtab.c | 146 int i, err = -EINVAL; in nlmsg_perm() local 148 for (i = 0; i < tabsize/sizeof(struct nlmsg_perm); i++) in nlmsg_perm() 149 if (nlmsg_type == tab[i].nlmsg_type) { in nlmsg_perm() 150 *perm = tab[i].perm; in nlmsg_perm() 212 int i; in nlmsg_set_getlink_perm() local 214 for (i = 0; i < ARRAY_SIZE(nlmsg_route_perms); i++) { in nlmsg_set_getlink_perm() 215 if (nlmsg_route_perms[i].nlmsg_type == RTM_GETLINK) { in nlmsg_set_getlink_perm() 216 nlmsg_route_perms[i].perm = perm; in nlmsg_set_getlink_perm()
|
D | selinuxfs.c | 102 int i; in selinux_fs_info_free() local 105 for (i = 0; i < fsi->bool_num; i++) in selinux_fs_info_free() 106 kfree(fsi->bool_pending_names[i]); in selinux_fs_info_free() 1036 int i, rc; in sel_write_user() local 1070 for (i = 0; i < nsids; i++) { in sel_write_user() 1071 rc = security_sid_to_context(state, sids[i], &newcon, &len); in sel_write_user() 1328 int i, ret; in sel_make_bools() local 1340 for (i = 0; i < fsi->bool_num; i++) in sel_make_bools() 1341 kfree(fsi->bool_pending_names[i]); in sel_make_bools() 1359 for (i = 0; i < num; i++) { in sel_make_bools() [all …]
|
/security/keys/ |
D | big_key.c | 141 unsigned int i; in big_key_free_buffer() local 148 for (i = 0; i < buf->nr_pages; i++) in big_key_free_buffer() 149 if (buf->pages[i]) in big_key_free_buffer() 150 __free_page(buf->pages[i]); in big_key_free_buffer() 163 unsigned int i, l; in big_key_alloc_buffer() local 176 for (i = 0; i < buf->nr_pages; i++) { in big_key_alloc_buffer() 177 buf->pages[i] = alloc_page(GFP_KERNEL); in big_key_alloc_buffer() 178 if (!buf->pages[i]) in big_key_alloc_buffer() 182 sg_set_page(&buf->sg[i], buf->pages[i], l, 0); in big_key_alloc_buffer()
|