Lines Matching refs:i
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()
211 unsigned int i, n = mapping->num_perms; in map_decision() local
214 for (i = 0, result = 0; i < n; i++) { in map_decision()
215 if (avd->allowed & mapping->perms[i]) in map_decision()
216 result |= 1<<i; in map_decision()
217 if (allow_unknown && !mapping->perms[i]) in map_decision()
218 result |= 1<<i; in map_decision()
222 for (i = 0, result = 0; i < n; i++) in map_decision()
223 if (avd->auditallow & mapping->perms[i]) in map_decision()
224 result |= 1<<i; in map_decision()
227 for (i = 0, result = 0; i < n; i++) { in map_decision()
228 if (avd->auditdeny & mapping->perms[i]) in map_decision()
229 result |= 1<<i; in map_decision()
230 if (!allow_unknown && !mapping->perms[i]) in map_decision()
231 result |= 1<<i; in map_decision()
238 for (; i < (sizeof(u32)*8); i++) in map_decision()
239 result |= 1<<i; in map_decision()
592 unsigned int i; in services_compute_xperms_drivers() local
596 for (i = 0; i < ARRAY_SIZE(xperms->drivers.p); i++) in services_compute_xperms_drivers()
597 xperms->drivers.p[i] |= node->datum.u.xperms->perms.p[i]; in services_compute_xperms_drivers()
627 unsigned int i, j; in context_struct_compute_av() local
653 ebitmap_for_each_positive_bit(sattr, snode, i) { in context_struct_compute_av()
655 avkey.source_type = i + 1; in context_struct_compute_av()
947 unsigned int i; in services_compute_xperms_decision() local
967 for (i = 0; i < ARRAY_SIZE(xpermd->allowed->p); i++) in services_compute_xperms_decision()
968 xpermd->allowed->p[i] |= in services_compute_xperms_decision()
969 node->datum.u.xperms->perms.p[i]; in services_compute_xperms_decision()
978 for (i = 0; i < ARRAY_SIZE(xpermd->auditallow->p); i++) in services_compute_xperms_decision()
979 xpermd->auditallow->p[i] |= in services_compute_xperms_decision()
980 node->datum.u.xperms->perms.p[i]; in services_compute_xperms_decision()
989 for (i = 0; i < ARRAY_SIZE(xpermd->dontaudit->p); i++) in services_compute_xperms_decision()
990 xpermd->dontaudit->p[i] |= in services_compute_xperms_decision()
991 node->datum.u.xperms->perms.p[i]; in services_compute_xperms_decision()
1013 unsigned int i, j; in security_compute_xperms_decision() local
1059 ebitmap_for_each_positive_bit(sattr, snode, i) { in security_compute_xperms_decision()
1061 avkey.source_type = i + 1; in security_compute_xperms_decision()
1520 int i; in security_context_to_sid_core() local
1522 for (i = 1; i < SECINITSID_NUM; i++) { in security_context_to_sid_core()
1523 if (!strcmp(initial_sid_to_string[i], scontext2)) { in security_context_to_sid_core()
1524 *sid = i; in security_context_to_sid_core()
2106 unsigned int i; in security_load_policycaps() local
2109 for (i = 0; i < ARRAY_SIZE(state->policycap); i++) in security_load_policycaps()
2110 state->policycap[i] = ebitmap_get_bit(&p->policycaps, i); in security_load_policycaps()
2112 for (i = 0; i < ARRAY_SIZE(selinux_policycap_names); i++) in security_load_policycaps()
2114 selinux_policycap_names[i], in security_load_policycaps()
2115 ebitmap_get_bit(&p->policycaps, i)); in security_load_policycaps()
2117 ebitmap_for_each_positive_bit(&p->policycaps, node, i) { in security_load_policycaps()
2118 if (i >= ARRAY_SIZE(selinux_policycap_names)) in security_load_policycaps()
2120 i); in security_load_policycaps()
2491 int i, fail = 0; in match_ipv6_addrmask() local
2493 for (i = 0; i < 4; i++) in match_ipv6_addrmask()
2494 if (addr[i] != (input[i] & mask[i])) { in match_ipv6_addrmask()
2610 int rc = 0, i, j; in security_get_user_sids() local
2642 ebitmap_for_each_positive_bit(&user->roles, rnode, i) { in security_get_user_sids()
2643 role = policydb->role_val_to_struct[i]; in security_get_user_sids()
2644 usercon.role = i + 1; in security_get_user_sids()
2689 for (i = 0, j = 0; i < mynel; i++) { in security_get_user_sids()
2692 fromsid, mysids[i], in security_get_user_sids()
2697 mysids2[j++] = mysids[i]; in security_get_user_sids()
2851 int i, rc; in security_get_bools() local
2882 for (i = 0; i < *len; i++) { in security_get_bools()
2883 (*values)[i] = policydb->bool_val_to_struct[i]->state; in security_get_bools()
2886 (*names)[i] = kstrdup(sym_name(policydb, SYM_BOOLS, i), in security_get_bools()
2888 if (!(*names)[i]) in security_get_bools()
2897 for (i = 0; i < *len; i++) in security_get_bools()
2898 kfree((*names)[i]); in security_get_bools()
2908 int i, rc; in security_set_bools() local
2921 for (i = 0; i < len; i++) { in security_set_bools()
2922 if (!!values[i] != policydb->bool_val_to_struct[i]->state) { in security_set_bools()
2926 sym_name(policydb, SYM_BOOLS, i), in security_set_bools()
2927 !!values[i], in security_set_bools()
2928 policydb->bool_val_to_struct[i]->state, in security_set_bools()
2932 if (values[i]) in security_set_bools()
2933 policydb->bool_val_to_struct[i]->state = 1; in security_set_bools()
2935 policydb->bool_val_to_struct[i]->state = 0; in security_set_bools()
2982 int rc, nbools = 0, *bvalues = NULL, i; in security_preserve_bools() local
2990 for (i = 0; i < nbools; i++) { in security_preserve_bools()
2991 booldatum = hashtab_search(policydb->p_bools.table, bnames[i]); in security_preserve_bools()
2993 booldatum->state = bvalues[i]; in security_preserve_bools()
3003 for (i = 0; i < nbools; i++) in security_preserve_bools()
3004 kfree(bnames[i]); in security_preserve_bools()
3212 int i; in security_get_classes() local
3213 for (i = 0; i < *nclasses; i++) in security_get_classes()
3214 kfree((*classes)[i]); in security_get_classes()
3240 int rc, i; in security_get_permissions() local
3277 for (i = 0; i < *nperms; i++) in security_get_permissions()
3278 kfree((*perms)[i]); in security_get_permissions()
3433 int i; in selinux_audit_rule_known() local
3435 for (i = 0; i < rule->field_count; i++) { in selinux_audit_rule_known()
3436 struct audit_field *f = &rule->fields[i]; in selinux_audit_rule_known()