Lines Matching refs:profile

317 		struct aa_profile *profile;  in aa_label_destroy()  local
322 label_for_each(i, label, profile) { in aa_label_destroy()
323 aa_put_profile(profile); in aa_label_destroy()
1258 static inline bool label_is_visible(struct aa_profile *profile, in label_is_visible() argument
1261 return aa_ns_visible(profile->ns, labels_ns(label), true); in label_is_visible()
1269 static inline unsigned int match_component(struct aa_profile *profile, in match_component() argument
1275 if (profile->ns == tp->ns) in match_component()
1276 return aa_dfa_match(profile->policy.dfa, state, tp->base.hname); in match_component()
1279 ns_name = aa_ns_name(profile->ns, tp->ns, true); in match_component()
1280 state = aa_dfa_match_len(profile->policy.dfa, state, ":", 1); in match_component()
1281 state = aa_dfa_match(profile->policy.dfa, state, ns_name); in match_component()
1282 state = aa_dfa_match_len(profile->policy.dfa, state, ":", 1); in match_component()
1283 return aa_dfa_match(profile->policy.dfa, state, tp->base.hname); in match_component()
1301 static int label_compound_match(struct aa_profile *profile, in label_compound_match() argument
1311 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_compound_match()
1313 state = match_component(profile, tp, state); in label_compound_match()
1325 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_compound_match()
1327 state = aa_dfa_match(profile->policy.dfa, state, "//&"); in label_compound_match()
1328 state = match_component(profile, tp, state); in label_compound_match()
1332 aa_compute_perms(profile->policy.dfa, state, perms); in label_compound_match()
1333 aa_apply_modes_to_perms(profile, perms); in label_compound_match()
1359 static int label_components_match(struct aa_profile *profile, in label_components_match() argument
1371 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_components_match()
1373 state = match_component(profile, tp, start); in label_components_match()
1383 aa_compute_perms(profile->policy.dfa, state, &tmp); in label_components_match()
1384 aa_apply_modes_to_perms(profile, &tmp); in label_components_match()
1387 if (!aa_ns_visible(profile->ns, tp->ns, subns)) in label_components_match()
1389 state = match_component(profile, tp, start); in label_components_match()
1392 aa_compute_perms(profile->policy.dfa, state, &tmp); in label_components_match()
1393 aa_apply_modes_to_perms(profile, &tmp); in label_components_match()
1418 int aa_label_match(struct aa_profile *profile, struct aa_label *label, in aa_label_match() argument
1422 int error = label_compound_match(profile, label, state, subns, request, in aa_label_match()
1428 return label_components_match(profile, label, state, subns, request, in aa_label_match()
1513 struct aa_profile *profile, int flags, in aa_profile_snxprint() argument
1519 AA_BUG(!profile); in aa_profile_snxprint()
1522 view = profiles_ns(profile); in aa_profile_snxprint()
1524 if (view != profile->ns && in aa_profile_snxprint()
1525 (!prev_ns || (*prev_ns != profile->ns))) { in aa_profile_snxprint()
1527 *prev_ns = profile->ns; in aa_profile_snxprint()
1528 ns_name = aa_ns_name(view, profile->ns, in aa_profile_snxprint()
1537 if ((flags & FLAG_SHOW_MODE) && profile != profile->ns->unconfined) { in aa_profile_snxprint()
1538 const char *modestr = aa_profile_mode_names[profile->mode]; in aa_profile_snxprint()
1542 profile->base.hname, modestr); in aa_profile_snxprint()
1543 return snprintf(str, size, "%s (%s)", profile->base.hname, in aa_profile_snxprint()
1549 profile->base.hname); in aa_profile_snxprint()
1550 return snprintf(str, size, "%s", profile->base.hname); in aa_profile_snxprint()
1556 struct aa_profile *profile; in label_modename() local
1560 label_for_each(i, label, profile) { in label_modename()
1561 if (aa_ns_visible(ns, profile->ns, flags & FLAG_VIEW_SUBNS)) { in label_modename()
1563 if (profile == profile->ns->unconfined) in label_modename()
1570 mode = profile->mode; in label_modename()
1571 else if (mode != profile->mode) in label_modename()
1590 struct aa_profile *profile; in display_mode() local
1593 label_for_each(i, label, profile) { in display_mode()
1594 if (aa_ns_visible(ns, profile->ns, in display_mode()
1596 profile != profile->ns->unconfined) in display_mode()
1626 struct aa_profile *profile; in aa_label_snxprint() local
1643 label_for_each(i, label, profile) { in aa_label_snxprint()
1644 if (aa_ns_visible(ns, profile->ns, flags & FLAG_VIEW_SUBNS)) { in aa_label_snxprint()
1649 len = aa_profile_snxprint(str, size, ns, profile, in aa_label_snxprint()
1889 DEFINE_VEC(profile, vec); in aa_label_strn_parse()
1911 error = vec_setup(profile, vec, len, gfp); in aa_label_strn_parse()
1958 vec_cleanup(profile, vec, len); in aa_label_strn_parse()