/security/selinux/ss/ |
D | sidtab.c | 20 int i; in sidtab_init() local 25 for (i = 0; i < SIDTAB_SIZE; i++) in sidtab_init() 26 s->htable[i] = NULL; in sidtab_init() 125 int i, rc = 0; in sidtab_map() local 131 for (i = 0; i < SIDTAB_SIZE; i++) { in sidtab_map() 132 cur = s->htable[i]; in sidtab_map() 158 int i; in sidtab_search_context() local 161 for (i = 0; i < SIDTAB_SIZE; i++) { in sidtab_search_context() 162 cur = s->htable[i]; in sidtab_search_context() 176 int i; in sidtab_search_cache() local [all …]
|
D | hashtab.c | 18 u32 i; in hashtab_create() local 34 for (i = 0; i < size; i++) in hashtab_create() 35 p->htable[i] = NULL; in hashtab_create() 99 u32 i; in hashtab_destroy() local 105 for (i = 0; i < h->size; i++) { in hashtab_destroy() 106 cur = h->htable[i]; in hashtab_destroy() 112 h->htable[i] = NULL; in hashtab_destroy() 125 u32 i; in hashtab_map() local 132 for (i = 0; i < h->size; i++) { in hashtab_map() 133 cur = h->htable[i]; in hashtab_map() [all …]
|
D | services.c | 131 u16 i, j; in selinux_set_mapping() local 138 i = 0; in selinux_set_mapping() 139 while (map[i].name) in selinux_set_mapping() 140 i++; in selinux_set_mapping() 143 out_map = kcalloc(++i, size, GFP_ATOMIC); in selinux_set_mapping() 199 *out_map_size = i; in selinux_set_mapping() 223 u16 i; in map_class() local 225 for (i = 1; i < current_mapping_size; i++) { in map_class() 226 if (current_mapping[i].value == pol_value) in map_class() 227 return i; in map_class() [all …]
|
D | avtab.c | 281 int i; in avtab_destroy() local 287 for (i = 0; i < h->nslot; i++) { in avtab_destroy() 288 cur = flex_array_get_ptr(h->htable, i); in avtab_destroy() 348 int i, chain_len, slots_used, max_chain_len; in avtab_hash_eval() local 355 for (i = 0; i < h->nslot; i++) { in avtab_hash_eval() 356 cur = flex_array_get_ptr(h->htable, i); in avtab_hash_eval() 401 int i, rc; in avtab_read_item() local 462 for (i = 0; i < ARRAY_SIZE(spec_order); i++) { in avtab_read_item() 463 if (val & spec_order[i]) { in avtab_read_item() 464 key.specified = spec_order[i] | enabled; in avtab_read_item() [all …]
|
D | policydb.c | 170 int i; in policydb_lookup_compat() local 173 for (i = 0; i < ARRAY_SIZE(policydb_compat); i++) { in policydb_lookup_compat() 174 if (policydb_compat[i].version == version) { in policydb_lookup_compat() 175 info = &policydb_compat[i]; in policydb_lookup_compat() 285 int i, rc; in policydb_init() local 289 for (i = 0; i < SYM_NUM; i++) { in policydb_init() 290 rc = symtab_init(&p->symtab[i], symtab_sizes[i]); in policydb_init() 327 for (i = 0; i < SYM_NUM; i++) { in policydb_init() 328 hashtab_map(p->symtab[i].table, destroy_f[i], NULL); in policydb_init() 329 hashtab_destroy(p->symtab[i].table); 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(&policydb, SYM_CATS, i); in mls_compute_context_len() 64 head = i; in mls_compute_context_len() 66 prev = i; in mls_compute_context_len() 93 int i, l, head, prev; in mls_sid_to_context() local 114 ebitmap_for_each_positive_bit(e, node, i) { in mls_sid_to_context() 115 if (i - prev > 1) { in mls_sid_to_context() 130 nm = sym_name(&policydb, 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() 352 int rc, i; in ebitmap_read() local [all …]
|
/security/apparmor/include/ |
D | label.h | 35 typeof(N) i; \ 37 for (i = 0; i < (N); i++) \ 38 (V)[i] = NULL; \ 46 int i; \ 47 for (i = 0; i < (N); i++) { \ 48 if (!IS_ERR_OR_NULL((V)[i])) \ 49 aa_put_ ## T((V)[i]); \ 115 int i, j; member 158 int aa_label_next_confined(struct aa_label *l, int i); 162 for ((I).i = 0; ((P) = (L)->vec[(I).i]); ++((I).i)) [all …]
|
/security/integrity/ima/ |
D | ima_template.c | 130 int i; in lookup_template_field() local 132 for (i = 0; i < ARRAY_SIZE(supported_fields); i++) in lookup_template_field() 133 if (strncmp(supported_fields[i].field_id, field_id, in lookup_template_field() 135 return &supported_fields[i]; in lookup_template_field() 143 int i = 0, j = 0; in template_fmt_size() local 145 while (i < template_fmt_len) { in template_fmt_size() 146 c = template_fmt[i]; in template_fmt_size() 149 i++; in template_fmt_size() 162 int i, len; in template_desc_init_fields() local 175 for (i = 0, template_fmt_ptr = template_fmt; i < template_num_fields; in template_desc_init_fields() [all …]
|
D | ima_api.c | 29 int i; in ima_free_template_entry() local 31 for (i = 0; i < entry->template_desc->num_fields; i++) in ima_free_template_entry() 32 kfree(entry->template_data[i].data); in ima_free_template_entry() 44 int i, result = 0; in ima_alloc_init_template() local 52 for (i = 0; i < template_desc->num_fields; i++) { in ima_alloc_init_template() 53 struct ima_template_field *field = template_desc->fields[i]; in ima_alloc_init_template() 57 &((*entry)->template_data[i])); in ima_alloc_init_template() 61 len = (*entry)->template_data[i].len; in ima_alloc_init_template() 313 int i; in ima_audit_measurement() local 318 for (i = 0; i < iint->ima_hash->length; i++) in ima_audit_measurement() [all …]
|
D | ima_policy.c | 225 int i; in ima_lsm_update_rules() local 228 for (i = 0; i < MAX_LSM_RULES; i++) { in ima_lsm_update_rules() 229 if (!entry->lsm[i].rule) in ima_lsm_update_rules() 231 result = security_filter_rule_init(entry->lsm[i].type, in ima_lsm_update_rules() 233 entry->lsm[i].args_p, in ima_lsm_update_rules() 234 &entry->lsm[i].rule); in ima_lsm_update_rules() 235 BUG_ON(!entry->lsm[i].rule); in ima_lsm_update_rules() 254 int i; in ima_match_rules() local 286 for (i = 0; i < MAX_LSM_RULES; i++) { in ima_match_rules() 291 if (!rule->lsm[i].rule) in ima_match_rules() [all …]
|
D | ima_fs.c | 137 int i; in ima_measurements_show() local 177 for (i = 0; i < e->template_desc->num_fields; i++) { in ima_measurements_show() 179 struct ima_template_field *field = 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 …]
|
D | ima_template_lib.c | 181 int i; in ima_parse_buf() local 183 for (i = 0; i < maxfields; i++) { in ima_parse_buf() 184 if (len_mask == NULL || !test_bit(i, len_mask)) { in ima_parse_buf() 188 fields[i].len = *(u32 *)bufp; in ima_parse_buf() 190 fields[i].len = le32_to_cpu(fields[i].len); in ima_parse_buf() 195 if (bufp > (bufendp - fields[i].len)) in ima_parse_buf() 198 fields[i].data = bufp; in ima_parse_buf() 199 bufp += fields[i].len; in ima_parse_buf() 202 if ((enforce_mask & ENFORCE_FIELDS) && i != maxfields) { in ima_parse_buf() 204 bufname, maxfields, i); in ima_parse_buf() [all …]
|
/security/apparmor/ |
D | label.c | 171 int i; in vec_cmp() local 180 for (i = 0; i < an && i < bn; i++) { in vec_cmp() 181 int res = profile_cmp(a[i], b[i]); in vec_cmp() 192 int i; in vec_is_stale() local 196 for (i = 0; i < n; i++) { in vec_is_stale() 197 if (profile_is_stale(vec[i])) in vec_is_stale() 206 int i; in vec_unconfined() local 210 for (i = 0; i < n; i++) { in vec_unconfined() 211 if (!profile_unconfined(vec[i])) in vec_unconfined() 230 int i, pos, dups = 0; in unique() local [all …]
|
D | match.c | 133 size_t i, state_count, trans_count; in verify_dfa() local 170 for (i = 0; i < state_count; i++) { in verify_dfa() 171 if (DEFAULT_TABLE(dfa)[i] >= state_count) in verify_dfa() 173 if (base_idx(BASE_TABLE(dfa)[i]) + 255 >= trans_count) { in verify_dfa() 180 for (i = 0; i < trans_count; i++) { in verify_dfa() 181 if (NEXT_TABLE(dfa)[i] >= state_count) in verify_dfa() 183 if (CHECK_TABLE(dfa)[i] >= state_count) in verify_dfa() 202 int i; in dfa_free() local 204 for (i = 0; i < ARRAY_SIZE(dfa->tables); i++) { in dfa_free() 205 kvfree(dfa->tables[i]); in dfa_free() [all …]
|
D | policy_unpack.c | 387 int i; in verify_accept() local 390 for (i = 0; i < dfa->tables[YYTD_ID_ACCEPT]->td_lolen; i++) { in verify_accept() 391 int mode = ACCEPT_TABLE(dfa)[i]; in verify_accept() 396 if (ACCEPT_TABLE2(dfa)[i] & ~DFA_VALID_PERM2_MASK) in verify_accept() 455 int i, size; in unpack_trans_table() local 467 for (i = 0; i < size; i++) { in unpack_trans_table() 475 profile->file.trans.table[i] = str; in unpack_trans_table() 524 int i, size; in unpack_rlimits() local 533 for (i = 0; i < size; i++) { in unpack_rlimits() 535 int a = aa_map_resource(i); in unpack_rlimits() [all …]
|
/security/tomoyo/ |
D | gc.c | 79 int i; in tomoyo_name_used_by_io_buffer() local 83 for (i = 0; i < TOMOYO_MAX_IO_READ_QUEUE; i++) { in tomoyo_name_used_by_io_buffer() 84 const char *w = head->r.w[i]; in tomoyo_name_used_by_io_buffer() 278 unsigned int i; in tomoyo_del_condition() local 289 for (i = 0; i < numbers_count; i++) in tomoyo_del_condition() 291 for (i = 0; i < names_count; i++) in tomoyo_del_condition() 293 for (i = 0; i < argc; argv++, i++) in tomoyo_del_condition() 295 for (i = 0; i < envc; envp++, i++) { in tomoyo_del_condition() 513 int i; in tomoyo_collect_entry() local 531 for (i = 0; i < TOMOYO_MAX_ACL_GROUPS; i++) in tomoyo_collect_entry() [all …]
|
D | common.c | 430 int i; in tomoyo_print_number_union_nospace() local 437 for (i = 0; i < 2; i++) { in tomoyo_print_number_union_nospace() 568 static void tomoyo_set_uint(unsigned int *i, const char *string, in tomoyo_set_uint() argument 573 sscanf(cp + strlen(find), "=%u", i); in tomoyo_set_uint() 588 u8 i; in tomoyo_set_mode() local 591 i = TOMOYO_MAX_MAC_INDEX + TOMOYO_MAX_MAC_CATEGORY_INDEX; in tomoyo_set_mode() 595 for (i = 0; i < TOMOYO_MAX_MAC_INDEX in tomoyo_set_mode() 596 + TOMOYO_MAX_MAC_CATEGORY_INDEX; i++) { in tomoyo_set_mode() 598 if (i < TOMOYO_MAX_MAC_INDEX) { in tomoyo_set_mode() 599 const u8 c = tomoyo_index2category[i]; in tomoyo_set_mode() [all …]
|
D | condition.c | 29 int i; in tomoyo_argv() local 32 for (i = 0; i < argc; argv++, checked++, i++) { in tomoyo_argv() 62 int i; in tomoyo_envp() local 69 for (i = 0; i < envc; envp++, checked++, i++) { in tomoyo_envp() 184 int i; in tomoyo_scan_bprm() local 186 for (i = 0; i < argc; i++) { in tomoyo_scan_bprm() 187 if (checked[i]) in tomoyo_scan_bprm() 193 if (argv[i].is_not) in tomoyo_scan_bprm() 198 for (i = 0; i < envc; envp++, i++) { in tomoyo_scan_bprm() 199 if (checked[argc + i]) in tomoyo_scan_bprm() [all …]
|
D | util.c | 700 int i; in tomoyo_file_matches_pattern2() local 745 for (i = 0; i <= filename_end - filename; i++) { in tomoyo_file_matches_pattern2() 747 filename + i, filename_end, in tomoyo_file_matches_pattern2() 750 c = filename[i]; in tomoyo_file_matches_pattern2() 755 if (filename[i + 1] == '\\') in tomoyo_file_matches_pattern2() 756 i++; in tomoyo_file_matches_pattern2() 757 else if (tomoyo_byte_range(filename + i + 1)) in tomoyo_file_matches_pattern2() 758 i += 3; in tomoyo_file_matches_pattern2() 776 for (i = 1; i <= j; i++) { in tomoyo_file_matches_pattern2() 778 filename + i, filename_end, in tomoyo_file_matches_pattern2() [all …]
|
D | realpath.c | 24 int i; in tomoyo_encode2() local 32 for (i = 0; i < str_len; i++) { in tomoyo_encode2() 33 const unsigned char c = p[i]; in tomoyo_encode2() 49 for (i = 0; i < str_len; i++) { in tomoyo_encode2() 50 const unsigned char c = p[i]; in tomoyo_encode2()
|
/security/smack/ |
D | smack_access.c | 293 int i = 0; in smack_str_from_perm() local 296 string[i++] = 'r'; in smack_str_from_perm() 298 string[i++] = 'w'; in smack_str_from_perm() 300 string[i++] = 'x'; in smack_str_from_perm() 302 string[i++] = 'a'; in smack_str_from_perm() 304 string[i++] = 't'; in smack_str_from_perm() 306 string[i++] = 'l'; in smack_str_from_perm() 307 string[i] = '\0'; in smack_str_from_perm() 451 int i; in smk_parse_smack() local 464 for (i = 0; i < len; i++) in smk_parse_smack() [all …]
|
D | smackfs.c | 423 int i; in smk_parse_long_rule() local 428 for (i = 0; i < tokens; ++i) { in smk_parse_long_rule() 436 tok[i] = data + cnt; in smk_parse_long_rule() 444 while (i < 4) in smk_parse_long_rule() 445 tok[i++] = NULL; in smk_parse_long_rule() 565 int i = *pos; in smk_seq_start() local 571 if (i-- == 0) in smk_seq_start() 802 int i; in cipso_seq_show() local 817 for (i = netlbl_catmap_walk(cmp, 0); i >= 0; in cipso_seq_show() 818 i = netlbl_catmap_walk(cmp, i + 1)) { in cipso_seq_show() [all …]
|
/security/selinux/ |
D | nlmsgtab.c | 143 int i, err = -EINVAL; in nlmsg_perm() local 145 for (i = 0; i < tabsize/sizeof(struct nlmsg_perm); i++) in nlmsg_perm() 146 if (nlmsg_type == tab[i].nlmsg_type) { in nlmsg_perm() 147 *perm = tab[i].perm; in nlmsg_perm() 201 int i; in nlmsg_set_getlink_perm() local 203 for (i = 0; i < ARRAY_SIZE(nlmsg_route_perms); i++) { in nlmsg_set_getlink_perm() 204 if (nlmsg_route_perms[i].nlmsg_type == RTM_GETLINK) { in nlmsg_set_getlink_perm() 205 nlmsg_route_perms[i].perm = perm; in nlmsg_set_getlink_perm()
|
D | selinuxfs.c | 969 int i, rc; in sel_write_user() local 1002 for (i = 0; i < nsids; i++) { in sel_write_user() 1003 rc = security_sid_to_context(sids[i], &newcon, &len); in sel_write_user() 1255 int i, ret; in sel_make_bools() local 1267 for (i = 0; i < bool_num; i++) in sel_make_bools() 1268 kfree(bool_pending_names[i]); in sel_make_bools() 1286 for (i = 0; i < num; i++) { in sel_make_bools() 1288 dentry = d_alloc_name(dir, names[i]); in sel_make_bools() 1298 len = snprintf(page, PAGE_SIZE, "/%s/%s", BOOL_DIR_NAME, names[i]); in sel_make_bools() 1313 inode->i_ino = i|SEL_BOOL_INO_OFFSET; in sel_make_bools() [all …]
|