Home
last modified time | relevance | path

Searched refs:avrule (Results 1 – 21 of 21) sorted by relevance

/external/selinux/libsepol/src/
Dassertion.c34 avrule_t *avrule; member
39 static void report_failure(sepol_handle_t *handle, policydb_t *p, const avrule_t *avrule, in report_failure() argument
43 if (avrule->source_filename) { in report_failure()
45 avrule->source_line, avrule->source_filename, avrule->line, in report_failure()
50 } else if (avrule->line) { in report_failure()
52 avrule->line, p->p_type_val_to_name[stype], in report_failure()
141 policydb_t *p, const avrule_t *avrule, in report_assertion_extended_permissions() argument
176 rc = check_extended_permissions(avrule->xperms, xperms); in report_assertion_extended_permissions()
179 extended_permissions_violated(&error, avrule->xperms, xperms); in report_assertion_extended_permissions()
182 avrule->source_line, avrule->source_filename, avrule->line, in report_assertion_extended_permissions()
[all …]
Dmodule_to_cil.c1160 static int avrule_list_to_cil(int indent, struct policydb *pdb, struct avrule *avrule_list, struct … in avrule_list_to_cil()
1163 struct avrule *avrule; in avrule_list_to_cil() local
1169 for (avrule = avrule_list; avrule != NULL; avrule = avrule->next) { in avrule_list_to_cil()
1170 if ((avrule->specified & (AVRULE_NEVERALLOW|AVRULE_XPERMS_NEVERALLOW)) && in avrule_list_to_cil()
1171 avrule->source_filename) { in avrule_list_to_cil()
1172 cil_println(0, ";;* lmx %lu %s\n",avrule->source_line, avrule->source_filename); in avrule_list_to_cil()
1175 ts = &avrule->stypes; in avrule_list_to_cil()
1181 ts = &avrule->ttypes; in avrule_list_to_cil()
1189 if (avrule->specified & AVRULE_XPERMS) { in avrule_list_to_cil()
1190 …rc = avrulex_to_cil(indent, pdb, avrule->specified, snames[s], tnames[t], avrule->perms, avrule->x… in avrule_list_to_cil()
[all …]
Dwrite.c1616 static int avrule_write(avrule_t * avrule, struct policy_file *fp) in avrule_write() argument
1622 if (avrule->specified & AVRULE_XPERMS) { in avrule_write()
1629 buf[items++] = cpu_to_le32(avrule->specified); in avrule_write()
1630 buf[items++] = cpu_to_le32(avrule->flags); in avrule_write()
1635 if (type_set_write(&avrule->stypes, fp)) in avrule_write()
1638 if (type_set_write(&avrule->ttypes, fp)) in avrule_write()
1641 cur = avrule->perms; in avrule_write()
1652 cur = avrule->perms; in avrule_write()
1670 avrule_t *avrule; in avrule_write_list() local
1672 avrule = avrules; in avrule_write_list()
[all …]
Dexpand.c2630 avrule_t *avrule; in copy_neverallow() local
2644 avrule = (avrule_t *) malloc(sizeof(avrule_t)); in copy_neverallow()
2645 if (!avrule) in copy_neverallow()
2648 avrule_init(avrule); in copy_neverallow()
2649 avrule->specified = source_rule->specified; in copy_neverallow()
2650 avrule->line = source_rule->line; in copy_neverallow()
2651 avrule->flags = source_rule->flags; in copy_neverallow()
2652 avrule->source_line = source_rule->source_line; in copy_neverallow()
2654 avrule->source_filename = strdup(source_rule->source_filename); in copy_neverallow()
2655 if (!avrule->source_filename) in copy_neverallow()
[all …]
Dpolicydb.c3205 avrule_t *avrule; in avrule_read() local
3208 avrule = (avrule_t *) malloc(sizeof(avrule_t)); in avrule_read()
3209 if (!avrule) in avrule_read()
3212 avrule_init(avrule); in avrule_read()
3218 (avrule)->specified = le32_to_cpu(buf[0]); in avrule_read()
3219 (avrule)->flags = le32_to_cpu(buf[1]); in avrule_read()
3221 if (type_set_read(&avrule->stypes, fp)) in avrule_read()
3224 if (type_set_read(&avrule->ttypes, fp)) in avrule_read()
3248 avrule->perms = cur; in avrule_read()
3255 return avrule; in avrule_read()
[all …]
/external/selinux/checkpolicy/test/
Ddismod.c214 int display_avrule(avrule_t * avrule, policydb_t * policy, in display_avrule() argument
220 if (avrule == NULL) { in display_avrule()
224 if (avrule->specified & AVRULE_AV) { in display_avrule()
225 if (avrule->specified & AVRULE_ALLOWED) { in display_avrule()
228 if (avrule->specified & AVRULE_AUDITALLOW) { in display_avrule()
231 if (avrule->specified & AVRULE_DONTAUDIT) { in display_avrule()
234 } else if (avrule->specified & AVRULE_TYPE) { in display_avrule()
235 if (avrule->specified & AVRULE_TRANSITION) { in display_avrule()
238 if (avrule->specified & AVRULE_MEMBER) { in display_avrule()
241 if (avrule->specified & AVRULE_CHANGE) { in display_avrule()
[all …]
/external/selinux/python/sepolgen/src/sepolgen/
Daccess.py155 def avrule_to_access_vectors(avrule): argument
166 if isinstance(avrule, AccessVector):
167 return [avrule]
169 for src_type in avrule.src_types:
170 for tgt_type in avrule.tgt_types:
171 for obj_class in avrule.obj_classes:
176 access.perms = avrule.perms.copy()
Dpolicygen.py375 for avrule in node.avrules():
376 r.types.update(avrule.src_types)
377 r.types.update(avrule.tgt_types)
378 for obj in avrule.obj_classes:
379 r.add_obj_class(obj, avrule.perms)
Dinterfaces.py264 for avrule in interface.avrules():
265 if avrule.rule_type != refpolicy.AVRule.ALLOW:
271 avs = access.avrule_to_access_vectors(avrule)
/external/selinux/checkpolicy/
Dpolicy_define.c1612 avrule_t *avrule; in define_compute_type_helper() local
1617 avrule = malloc(sizeof(avrule_t)); in define_compute_type_helper()
1618 if (!avrule) { in define_compute_type_helper()
1622 avrule_init(avrule); in define_compute_type_helper()
1623 avrule->specified = which; in define_compute_type_helper()
1624 avrule->line = policydb_lineno; in define_compute_type_helper()
1625 avrule->source_line = source_lineno; in define_compute_type_helper()
1626 avrule->source_filename = strdup(source_file); in define_compute_type_helper()
1627 if (!avrule->source_filename) { in define_compute_type_helper()
1633 if (set_types(&avrule->stypes, id, &add, 0)) in define_compute_type_helper()
[all …]
Dmodule_compiler.h82 void append_avrule(avrule_t * avrule);
Dmodule_compiler.c25 avrule_block_t *avrule; member
1228 void append_avrule(avrule_t * avrule) in append_avrule() argument
1240 decl->avrules = avrule; in append_avrule()
1242 stack_top->last_avrule->next = avrule; in append_avrule()
1244 stack_top->last_avrule = avrule; in append_avrule()
1453 s->u.avrule = va_arg(ap, avrule_block_t *); in push_stack()
/external/selinux/libsepol/cil/src/
Dcil_find.c294 int cil_find_matching_avrule(struct cil_tree_node *node, struct cil_avrule *avrule, struct cil_avru… in cil_find_matching_avrule() argument
297 struct cil_symtab_datum *s1 = avrule->src; in cil_find_matching_avrule()
298 struct cil_symtab_datum *t1 = avrule->tgt; in cil_find_matching_avrule()
302 if (match_self != CIL_TRUE && avrule == target) goto exit; in cil_find_matching_avrule()
304 if (avrule->rule_kind != target->rule_kind) goto exit; in cil_find_matching_avrule()
306 if (avrule->is_extended != target->is_extended) goto exit; in cil_find_matching_avrule()
335 if (cil_classperms_list_match_any(avrule->perms.classperms, target->perms.classperms)) { in cil_find_matching_avrule()
339 if (cil_permissionx_match_any(avrule->perms.x.permx, target->perms.x.permx)) { in cil_find_matching_avrule()
Dcil_write_ast.c743 static int cil_write_avrule_x(struct cil_avrule *avrule, FILE *cil_out) { in cil_write_avrule_x() argument
748 switch (avrule->rule_kind) { in cil_write_avrule_x()
762 cil_log(CIL_ERR, "Unknown AVRULE type: %d\n", avrule->rule_kind); in cil_write_avrule_x()
767 src = avrule->src_str; in cil_write_avrule_x()
768 tgt = avrule->tgt_str; in cil_write_avrule_x()
770 if (avrule->perms.x.permx_str != NULL) { in cil_write_avrule_x()
771 xperms = strdup(avrule->perms.x.permx_str); in cil_write_avrule_x()
778 rc = cil_unfill_permx(avrule->perms.x.permx, &xperms); in cil_write_avrule_x()
789 static int cil_write_avrule_orig(struct cil_avrule *avrule, FILE *cil_out) { in cil_write_avrule_orig() argument
794 switch (avrule->rule_kind) { in cil_write_avrule_orig()
[all …]
Dandroid.c543 struct cil_avrule *avrule = (struct cil_avrule *)node->data; in cil_attrib_avrule() local
545 if (avrule->src != NULL) { in cil_attrib_avrule()
551 key = avrule->src_str; in cil_attrib_avrule()
554 avrule->src_str = __cil_attrib_get_versname(key, args->num); in cil_attrib_avrule()
557 key = avrule->tgt_str; in cil_attrib_avrule()
560 avrule->tgt_str = __cil_attrib_get_versname(key, args->num); in cil_attrib_avrule()
Dcil.c2159 void cil_avrule_init(struct cil_avrule **avrule) in cil_avrule_init() argument
2161 *avrule = cil_malloc(sizeof(**avrule)); in cil_avrule_init()
2163 (*avrule)->is_extended = 0; in cil_avrule_init()
2164 (*avrule)->rule_kind = CIL_NONE; in cil_avrule_init()
2165 (*avrule)->src_str = NULL; in cil_avrule_init()
2166 (*avrule)->src = NULL; in cil_avrule_init()
2167 (*avrule)->tgt_str = NULL; in cil_avrule_init()
2168 (*avrule)->tgt = NULL; in cil_avrule_init()
2169 memset(&((*avrule)->perms), 0, sizeof((*avrule)->perms)); in cil_avrule_init()
Dcil_binary.c4432 avrule_t *avrule; in __cil_init_sepol_avrule() local
4437 avrule = cil_malloc(sizeof(avrule_t)); in __cil_init_sepol_avrule()
4438 avrule->specified = kind; in __cil_init_sepol_avrule()
4439 avrule->flags = 0; in __cil_init_sepol_avrule()
4440 __cil_init_sepol_type_set(&avrule->stypes); in __cil_init_sepol_avrule()
4441 __cil_init_sepol_type_set(&avrule->ttypes); in __cil_init_sepol_avrule()
4442 avrule->perms = NULL; in __cil_init_sepol_avrule()
4443 avrule->line = node->line; in __cil_init_sepol_avrule()
4445 avrule->source_filename = NULL; in __cil_init_sepol_avrule()
4446 avrule->source_line = node->line; in __cil_init_sepol_avrule()
[all …]
Dcil_verify.c881 struct cil_avrule *avrule = NULL; in __cil_verify_booleanif_helper() local
882 avrule = rule_node->data; in __cil_verify_booleanif_helper()
883 if (avrule->rule_kind == CIL_AVRULE_NEVERALLOW) { in __cil_verify_booleanif_helper()
Dcil_internal.h1001 void cil_avrule_init(struct cil_avrule **avrule);
Dcil_post.c1906 struct cil_avrule *avrule = node->data; in __cil_post_db_classperms_helper() local
1907 rc = __evaluate_classperms_list(avrule->perms.classperms, db); in __cil_post_db_classperms_helper()
/external/selinux/libsepol/include/sepol/policydb/
Dpolicydb.h263 typedef struct avrule { struct
294 struct avrule *next; argument
671 extern int check_assertion(policydb_t *p, avrule_t *avrule);