Lines Matching refs:rules
565 static bool unpack_secmark(struct aa_ext *e, struct aa_ruleset *rules) in unpack_secmark() argument
575 rules->secmark = kcalloc(size, sizeof(struct aa_secmark), in unpack_secmark()
577 if (!rules->secmark) in unpack_secmark()
580 rules->secmark_count = size; in unpack_secmark()
583 if (!unpack_u8(e, &rules->secmark[i].audit, NULL)) in unpack_secmark()
585 if (!unpack_u8(e, &rules->secmark[i].deny, NULL)) in unpack_secmark()
587 if (!aa_unpack_strdup(e, &rules->secmark[i].label, NULL)) in unpack_secmark()
599 if (rules->secmark) { in unpack_secmark()
601 kfree(rules->secmark[i].label); in unpack_secmark()
602 kfree(rules->secmark); in unpack_secmark()
603 rules->secmark_count = 0; in unpack_secmark()
604 rules->secmark = NULL; in unpack_secmark()
611 static bool unpack_rlimits(struct aa_ext *e, struct aa_ruleset *rules) in unpack_rlimits() argument
622 rules->rlimits.mask = tmp; in unpack_rlimits()
632 rules->rlimits.limits[a].rlim_max = tmp2; in unpack_rlimits()
819 struct aa_ruleset *rules; in unpack_profile() local
862 rules = list_first_entry(&profile->rules, typeof(*rules), list); in unpack_profile()
945 if (!aa_unpack_cap_low(e, &rules->caps.allow, NULL)) in unpack_profile()
947 if (!aa_unpack_cap_low(e, &rules->caps.audit, NULL)) in unpack_profile()
949 if (!aa_unpack_cap_low(e, &rules->caps.quiet, NULL)) in unpack_profile()
957 if (!aa_unpack_cap_high(e, &rules->caps.allow, NULL)) in unpack_profile()
959 if (!aa_unpack_cap_high(e, &rules->caps.audit, NULL)) in unpack_profile()
961 if (!aa_unpack_cap_high(e, &rules->caps.quiet, NULL)) in unpack_profile()
972 if (!aa_unpack_cap_low(e, &rules->caps.extended, NULL)) in unpack_profile()
974 if (!aa_unpack_cap_high(e, &rules->caps.extended, NULL)) in unpack_profile()
985 if (!unpack_rlimits(e, rules)) { in unpack_profile()
990 if (!unpack_secmark(e, rules)) { in unpack_profile()
998 error = unpack_pdb(e, &rules->policy, true, false, in unpack_profile()
1003 if (aa_dfa_next(rules->policy->dfa, rules->policy->start[0], in unpack_profile()
1005 rules->policy->start[AA_CLASS_FILE] = in unpack_profile()
1006 aa_dfa_next(rules->policy->dfa, in unpack_profile()
1007 rules->policy->start[0], in unpack_profile()
1011 if (!rules->policy->perms) { in unpack_profile()
1012 error = aa_compat_map_policy(rules->policy, in unpack_profile()
1020 rules->policy = aa_get_pdb(nullpdb); in unpack_profile()
1023 error = unpack_pdb(e, &rules->file, false, true, &info); in unpack_profile()
1026 } else if (rules->file->dfa) { in unpack_profile()
1027 if (!rules->file->perms) { in unpack_profile()
1028 error = aa_compat_map_file(rules->file); in unpack_profile()
1034 } else if (rules->policy->dfa && in unpack_profile()
1035 rules->policy->start[AA_CLASS_FILE]) { in unpack_profile()
1036 aa_put_pdb(rules->file); in unpack_profile()
1037 rules->file = aa_get_pdb(rules->policy); in unpack_profile()
1039 aa_put_pdb(rules->file); in unpack_profile()
1040 rules->file = aa_get_pdb(nullpdb); in unpack_profile()
1243 struct aa_ruleset *rules = list_first_entry(&profile->rules, in verify_profile() local
1244 typeof(*rules), list); in verify_profile()
1245 if (!rules) in verify_profile()
1248 if (rules->file->dfa && !verify_dfa_accept_index(rules->file->dfa, in verify_profile()
1249 rules->file->size)) { in verify_profile()
1255 if (rules->policy->dfa && in verify_profile()
1256 !verify_dfa_accept_index(rules->policy->dfa, rules->policy->size)) { in verify_profile()
1263 if (!verify_perms(rules->file)) { in verify_profile()
1268 if (!verify_perms(rules->policy)) { in verify_profile()