Home
last modified time | relevance | path

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

/third_party/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
172 rc = check_extended_permissions(avrule->xperms, xperms); in report_assertion_extended_permissions()
175 extended_permissions_violated(&error, avrule->xperms, xperms); in report_assertion_extended_permissions()
178 avrule->source_line, avrule->source_filename, avrule->line, in report_assertion_extended_permissions()
[all …]
Dmodule_to_cil.c1181 static int avrule_list_to_cil(int indent, struct policydb *pdb, struct avrule *avrule_list, struct … in avrule_list_to_cil()
1184 struct avrule *avrule; in avrule_list_to_cil() local
1190 for (avrule = avrule_list; avrule != NULL; avrule = avrule->next) { in avrule_list_to_cil()
1191 if ((avrule->specified & (AVRULE_NEVERALLOW|AVRULE_XPERMS_NEVERALLOW)) && in avrule_list_to_cil()
1192 avrule->source_filename) { in avrule_list_to_cil()
1193 cil_println(0, ";;* lmx %lu %s\n",avrule->source_line, avrule->source_filename); in avrule_list_to_cil()
1196 ts = &avrule->stypes; in avrule_list_to_cil()
1202 ts = &avrule->ttypes; in avrule_list_to_cil()
1210 if (avrule->specified & AVRULE_XPERMS) { in avrule_list_to_cil()
1211 …rc = avrulex_to_cil(indent, pdb, avrule->specified, snames[s], tnames[t], avrule->perms, avrule->x… in avrule_list_to_cil()
[all …]
Dpolicydb_validate.c429 static int validate_avrules(sepol_handle_t *handle, avrule_t *avrule, validate_t flavors[]) in validate_avrules() argument
433 for (; avrule; avrule = avrule->next) { in validate_avrules()
434 if (validate_type_set(&avrule->stypes, &flavors[SYM_TYPES])) in validate_avrules()
436 if (validate_type_set(&avrule->ttypes, &flavors[SYM_TYPES])) in validate_avrules()
438 class = avrule->perms; in validate_avrules()
Dwrite.c1741 static int avrule_write(policydb_t *p, avrule_t * avrule, in avrule_write() argument
1749 buf[items++] = cpu_to_le32(avrule->specified); in avrule_write()
1750 buf[items++] = cpu_to_le32(avrule->flags); in avrule_write()
1755 if (type_set_write(&avrule->stypes, fp)) in avrule_write()
1758 if (type_set_write(&avrule->ttypes, fp)) in avrule_write()
1761 cur = avrule->perms; in avrule_write()
1772 cur = avrule->perms; in avrule_write()
1784 if (avrule->specified & AVRULE_XPERMS) { in avrule_write()
1785 size_t nel = ARRAY_SIZE(avrule->xperms->perms); in avrule_write()
1806 buf8 = avrule->xperms->specified; in avrule_write()
[all …]
Dexpand.c2614 avrule_t *avrule; in copy_neverallow() local
2628 avrule = (avrule_t *) malloc(sizeof(avrule_t)); in copy_neverallow()
2629 if (!avrule) in copy_neverallow()
2632 avrule_init(avrule); in copy_neverallow()
2633 avrule->specified = source_rule->specified; in copy_neverallow()
2634 avrule->line = source_rule->line; in copy_neverallow()
2635 avrule->flags = source_rule->flags; in copy_neverallow()
2636 avrule->source_line = source_rule->source_line; in copy_neverallow()
2638 avrule->source_filename = strdup(source_rule->source_filename); in copy_neverallow()
2639 if (!avrule->source_filename) in copy_neverallow()
[all …]
Dpolicydb.c3491 avrule_t *avrule; in avrule_read() local
3494 avrule = (avrule_t *) malloc(sizeof(avrule_t)); in avrule_read()
3495 if (!avrule) in avrule_read()
3498 avrule_init(avrule); in avrule_read()
3504 avrule->specified = le32_to_cpu(buf[0]); in avrule_read()
3505 avrule->flags = le32_to_cpu(buf[1]); in avrule_read()
3507 if (type_set_read(&avrule->stypes, fp)) in avrule_read()
3510 if (type_set_read(&avrule->ttypes, fp)) in avrule_read()
3534 avrule->perms = cur; in avrule_read()
3541 if (avrule->specified & AVRULE_XPERMS) { in avrule_read()
[all …]
/third_party/selinux/checkpolicy/test/
Ddismod.c213 static int display_avrule(avrule_t * avrule, policydb_t * policy, in display_avrule() argument
219 if (avrule == NULL) { in display_avrule()
223 if (avrule->specified & AVRULE_AV) { in display_avrule()
224 if (avrule->specified & AVRULE_ALLOWED) { in display_avrule()
227 if (avrule->specified & AVRULE_AUDITALLOW) { in display_avrule()
230 if (avrule->specified & AVRULE_DONTAUDIT) { in display_avrule()
233 } else if (avrule->specified & AVRULE_TYPE) { in display_avrule()
234 if (avrule->specified & AVRULE_TRANSITION) { in display_avrule()
237 if (avrule->specified & AVRULE_MEMBER) { in display_avrule()
240 if (avrule->specified & AVRULE_CHANGE) { in display_avrule()
[all …]
/third_party/selinux/checkpolicy/
Dpolicy_define.c1611 avrule_t *avrule; in define_compute_type_helper() local
1616 avrule = malloc(sizeof(avrule_t)); in define_compute_type_helper()
1617 if (!avrule) { in define_compute_type_helper()
1621 avrule_init(avrule); in define_compute_type_helper()
1622 avrule->specified = which; in define_compute_type_helper()
1623 avrule->line = policydb_lineno; in define_compute_type_helper()
1624 avrule->source_line = source_lineno; in define_compute_type_helper()
1625 avrule->source_filename = strdup(source_file); in define_compute_type_helper()
1626 if (!avrule->source_filename) { in define_compute_type_helper()
1632 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
1229 void append_avrule(avrule_t * avrule) in append_avrule() argument
1241 decl->avrules = avrule; in append_avrule()
1243 stack_top->last_avrule->next = avrule; in append_avrule()
1245 stack_top->last_avrule = avrule; in append_avrule()
1454 s->u.avrule = va_arg(ap, avrule_block_t *); in push_stack()
/third_party/selinux/libsepol/cil/src/
Dcil_find.c295 int cil_find_matching_avrule(struct cil_tree_node *node, struct cil_avrule *avrule, struct cil_avru… in cil_find_matching_avrule() argument
298 struct cil_symtab_datum *s1 = avrule->src; in cil_find_matching_avrule()
299 struct cil_symtab_datum *t1 = avrule->tgt; in cil_find_matching_avrule()
303 if (match_self != CIL_TRUE && avrule == target) goto exit; in cil_find_matching_avrule()
305 if (avrule->rule_kind != target->rule_kind) goto exit; in cil_find_matching_avrule()
307 if (avrule->is_extended != target->is_extended) goto exit; in cil_find_matching_avrule()
336 if (cil_classperms_list_match_any(avrule->perms.classperms, target->perms.classperms)) { in cil_find_matching_avrule()
340 if (cil_permissionx_match_any(avrule->perms.x.permx, target->perms.x.permx)) { in cil_find_matching_avrule()
Dcil.c2439 void cil_avrule_init(struct cil_avrule **avrule) in cil_avrule_init() argument
2441 *avrule = cil_malloc(sizeof(**avrule)); in cil_avrule_init()
2443 (*avrule)->is_extended = 0; in cil_avrule_init()
2444 (*avrule)->rule_kind = CIL_NONE; in cil_avrule_init()
2445 (*avrule)->src_str = NULL; in cil_avrule_init()
2446 (*avrule)->src = NULL; in cil_avrule_init()
2447 (*avrule)->tgt_str = NULL; in cil_avrule_init()
2448 (*avrule)->tgt = NULL; in cil_avrule_init()
2449 memset(&((*avrule)->perms), 0, sizeof((*avrule)->perms)); in cil_avrule_init()
Dcil_binary.c4480 avrule_t *avrule; in __cil_init_sepol_avrule() local
4486 avrule = cil_malloc(sizeof(avrule_t)); in __cil_init_sepol_avrule()
4487 avrule->specified = kind; in __cil_init_sepol_avrule()
4488 avrule->flags = 0; in __cil_init_sepol_avrule()
4489 __cil_init_sepol_type_set(&avrule->stypes); in __cil_init_sepol_avrule()
4490 __cil_init_sepol_type_set(&avrule->ttypes); in __cil_init_sepol_avrule()
4491 avrule->perms = NULL; in __cil_init_sepol_avrule()
4492 avrule->line = node->line; in __cil_init_sepol_avrule()
4494 avrule->source_filename = NULL; in __cil_init_sepol_avrule()
4495 avrule->source_line = node->line; in __cil_init_sepol_avrule()
[all …]
Dcil_verify.c1028 struct cil_avrule *avrule = NULL; in __cil_verify_booleanif_helper() local
1029 avrule = rule_node->data; in __cil_verify_booleanif_helper()
1030 if (avrule->rule_kind == CIL_AVRULE_NEVERALLOW) { in __cil_verify_booleanif_helper()
Dcil_internal.h1037 void cil_avrule_init(struct cil_avrule **avrule);
Dcil_post.c2234 struct cil_avrule *avrule = node->data; in __cil_post_db_classperms_helper() local
2235 rc = __evaluate_classperms_list(avrule->perms.classperms, db); in __cil_post_db_classperms_helper()
/third_party/selinux/libsepol/include/sepol/policydb/
Dpolicydb.h268 typedef struct avrule { struct
299 struct avrule *next; argument
698 extern int check_assertion(policydb_t *p, avrule_t *avrule);