Lines Matching refs:profile
323 struct aa_profile *profile; in label_destroy() local
328 label_for_each(i, label, profile) { in label_destroy()
329 aa_put_profile(profile); in label_destroy()
1235 static inline bool label_is_visible(struct aa_profile *profile, in label_is_visible() argument
1238 return aa_ns_visible(profile->ns, labels_ns(label), true); in label_is_visible()
1246 static inline unsigned int match_component(struct aa_profile *profile, in match_component() argument
1252 if (profile->ns == tp->ns) in match_component()
1253 return aa_dfa_match(profile->policy.dfa, state, tp->base.hname); in match_component()
1256 ns_name = aa_ns_name(profile->ns, tp->ns, true); in match_component()
1257 state = aa_dfa_match_len(profile->policy.dfa, state, ":", 1); in match_component()
1258 state = aa_dfa_match(profile->policy.dfa, state, ns_name); in match_component()
1259 state = aa_dfa_match_len(profile->policy.dfa, state, ":", 1); in match_component()
1260 return aa_dfa_match(profile->policy.dfa, state, tp->base.hname); in match_component()
1278 static int label_compound_match(struct aa_profile *profile, in label_compound_match() argument
1288 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_compound_match()
1290 state = match_component(profile, tp, state); in label_compound_match()
1302 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_compound_match()
1304 state = aa_dfa_match(profile->policy.dfa, state, "//&"); in label_compound_match()
1305 state = match_component(profile, tp, state); in label_compound_match()
1309 aa_compute_perms(profile->policy.dfa, state, perms); in label_compound_match()
1310 aa_apply_modes_to_perms(profile, perms); in label_compound_match()
1336 static int label_components_match(struct aa_profile *profile, in label_components_match() argument
1348 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_components_match()
1350 state = match_component(profile, tp, start); in label_components_match()
1360 aa_compute_perms(profile->policy.dfa, state, &tmp); in label_components_match()
1361 aa_apply_modes_to_perms(profile, &tmp); in label_components_match()
1364 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_components_match()
1366 state = match_component(profile, tp, start); in label_components_match()
1369 aa_compute_perms(profile->policy.dfa, state, &tmp); in label_components_match()
1370 aa_apply_modes_to_perms(profile, &tmp); in label_components_match()
1395 int aa_label_match(struct aa_profile *profile, struct aa_label *label, in aa_label_match() argument
1399 int error = label_compound_match(profile, label, state, subns, request, in aa_label_match()
1405 return label_components_match(profile, label, state, subns, request, in aa_label_match()
1490 struct aa_profile *profile, int flags, in aa_profile_snxprint() argument
1496 AA_BUG(!profile); in aa_profile_snxprint()
1499 view = profiles_ns(profile); in aa_profile_snxprint()
1501 if (view != profile->ns && in aa_profile_snxprint()
1502 (!prev_ns || (*prev_ns != profile->ns))) { in aa_profile_snxprint()
1504 *prev_ns = profile->ns; in aa_profile_snxprint()
1505 ns_name = aa_ns_name(view, profile->ns, in aa_profile_snxprint()
1514 if ((flags & FLAG_SHOW_MODE) && profile != profile->ns->unconfined) { in aa_profile_snxprint()
1515 const char *modestr = aa_profile_mode_names[profile->mode]; in aa_profile_snxprint()
1519 profile->base.hname, modestr); in aa_profile_snxprint()
1520 return snprintf(str, size, "%s (%s)", profile->base.hname, in aa_profile_snxprint()
1526 profile->base.hname); in aa_profile_snxprint()
1527 return snprintf(str, size, "%s", profile->base.hname); in aa_profile_snxprint()
1533 struct aa_profile *profile; in label_modename() local
1537 label_for_each(i, label, profile) { in label_modename()
1538 if (aa_ns_visible(ns, profile->ns, flags & FLAG_VIEW_SUBNS)) { in label_modename()
1539 if (profile->mode == APPARMOR_UNCONFINED) in label_modename()
1547 mode = profile->mode; in label_modename()
1548 else if (mode != profile->mode) in label_modename()
1567 struct aa_profile *profile; in display_mode() local
1570 label_for_each(i, label, profile) { in display_mode()
1571 if (aa_ns_visible(ns, profile->ns, in display_mode()
1573 profile != profile->ns->unconfined) in display_mode()
1603 struct aa_profile *profile; in aa_label_snxprint() local
1620 label_for_each(i, label, profile) { in aa_label_snxprint()
1621 if (aa_ns_visible(ns, profile->ns, flags & FLAG_VIEW_SUBNS)) { in aa_label_snxprint()
1626 len = aa_profile_snxprint(str, size, ns, profile, in aa_label_snxprint()
1861 DEFINE_VEC(profile, vec); in aa_label_parse()
1881 error = vec_setup(profile, vec, len, gfp); in aa_label_parse()
1927 vec_cleanup(profile, vec, len); in aa_label_parse()