Lines Matching refs:profile

608 static void profile_query_cb(struct aa_profile *profile, struct aa_perms *perms,  in profile_query_cb()  argument
615 if (profile_unconfined(profile)) in profile_query_cb()
617 if (profile->file.dfa && *match_str == AA_CLASS_FILE) { in profile_query_cb()
618 dfa = profile->file.dfa; in profile_query_cb()
619 state = aa_dfa_match_len(dfa, profile->file.start, in profile_query_cb()
626 } else if (profile->policy.dfa) { in profile_query_cb()
627 if (!PROFILE_MEDIATES(profile, *match_str)) in profile_query_cb()
629 dfa = profile->policy.dfa; in profile_query_cb()
630 state = aa_dfa_match_len(dfa, profile->policy.start[0], in profile_query_cb()
635 aa_apply_modes_to_perms(profile, &tmp); in profile_query_cb()
665 struct aa_profile *profile; in query_data() local
700 label_for_each_confined(i, label, profile) { in query_data()
701 if (!profile->data) in query_data()
704 data = rhashtable_lookup_fast(profile->data, &key, in query_data()
705 profile->data->p); in query_data()
754 struct aa_profile *profile; in query_label() local
786 label_for_each_in_ns(i, labels_ns(label), label, profile) { in query_label()
787 profile_query_cb(profile, &perms, match_str, match_len); in query_label()
790 label_for_each(i, label, profile) { in query_label()
791 profile_query_cb(profile, &perms, match_str, match_len); in query_label()
1067 struct aa_profile *profile = labels_profile(label); in seq_profile_name_show() local
1068 seq_printf(seq, "%s\n", profile->base.name); in seq_profile_name_show()
1078 struct aa_profile *profile = labels_profile(label); in seq_profile_mode_show() local
1079 seq_printf(seq, "%s\n", aa_profile_mode_names[profile->mode]); in seq_profile_mode_show()
1089 struct aa_profile *profile = labels_profile(label); in seq_profile_attach_show() local
1090 if (profile->attach) in seq_profile_attach_show()
1091 seq_printf(seq, "%s\n", profile->attach); in seq_profile_attach_show()
1092 else if (profile->xmatch) in seq_profile_attach_show()
1095 seq_printf(seq, "%s\n", profile->base.name); in seq_profile_attach_show()
1105 struct aa_profile *profile = labels_profile(label); in seq_profile_hash_show() local
1108 if (profile->hash) { in seq_profile_hash_show()
1110 seq_printf(seq, "%.2x", profile->hash[i]); in seq_profile_hash_show()
1157 struct aa_profile *profile; in seq_ns_nsstacked_show() local
1164 label_for_each(it, label, profile) in seq_ns_nsstacked_show()
1165 if (profile->ns != labels_ns(label)) { in seq_ns_nsstacked_show()
1502 void __aafs_profile_rmdir(struct aa_profile *profile) in __aafs_profile_rmdir() argument
1507 if (!profile) in __aafs_profile_rmdir()
1510 list_for_each_entry(child, &profile->base.profiles, base.list) in __aafs_profile_rmdir()
1515 if (!profile->dents[i]) in __aafs_profile_rmdir()
1518 proxy = d_inode(profile->dents[i])->i_private; in __aafs_profile_rmdir()
1519 aafs_remove(profile->dents[i]); in __aafs_profile_rmdir()
1521 profile->dents[i] = NULL; in __aafs_profile_rmdir()
1547 struct aa_profile *profile, in create_profile_file() argument
1550 struct aa_proxy *proxy = aa_get_proxy(profile->label.proxy); in create_profile_file()
1560 static int profile_depth(struct aa_profile *profile) in profile_depth() argument
1565 for (depth = 0; profile; profile = rcu_access_pointer(profile->parent)) in profile_depth()
1609 struct aa_profile *profile; in rawdata_get_link_base() local
1617 profile = labels_profile(label); in rawdata_get_link_base()
1618 depth = profile_depth(profile); in rawdata_get_link_base()
1619 target = gen_symlink_name(depth, profile->rawdata->name, name); in rawdata_get_link_base()
1666 int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent) in __aafs_profile_mkdir() argument
1672 AA_BUG(!profile); in __aafs_profile_mkdir()
1673 AA_BUG(!mutex_is_locked(&profiles_ns(profile)->lock)); in __aafs_profile_mkdir()
1677 p = aa_deref_parent(profile); in __aafs_profile_mkdir()
1686 if (!profile->dirname) { in __aafs_profile_mkdir()
1688 len = mangle_name(profile->base.name, NULL); in __aafs_profile_mkdir()
1689 id_len = snprintf(NULL, 0, ".%ld", profile->ns->uniq_id); in __aafs_profile_mkdir()
1691 profile->dirname = kmalloc(len + id_len + 1, GFP_KERNEL); in __aafs_profile_mkdir()
1692 if (!profile->dirname) { in __aafs_profile_mkdir()
1697 mangle_name(profile->base.name, profile->dirname); in __aafs_profile_mkdir()
1698 sprintf(profile->dirname + len, ".%ld", profile->ns->uniq_id++); in __aafs_profile_mkdir()
1701 dent = aafs_create_dir(profile->dirname, parent); in __aafs_profile_mkdir()
1704 prof_dir(profile) = dir = dent; in __aafs_profile_mkdir()
1706 dent = create_profile_file(dir, "name", profile, in __aafs_profile_mkdir()
1710 profile->dents[AAFS_PROF_NAME] = dent; in __aafs_profile_mkdir()
1712 dent = create_profile_file(dir, "mode", profile, in __aafs_profile_mkdir()
1716 profile->dents[AAFS_PROF_MODE] = dent; in __aafs_profile_mkdir()
1718 dent = create_profile_file(dir, "attach", profile, in __aafs_profile_mkdir()
1722 profile->dents[AAFS_PROF_ATTACH] = dent; in __aafs_profile_mkdir()
1724 if (profile->hash) { in __aafs_profile_mkdir()
1725 dent = create_profile_file(dir, "sha1", profile, in __aafs_profile_mkdir()
1729 profile->dents[AAFS_PROF_HASH] = dent; in __aafs_profile_mkdir()
1732 if (profile->rawdata) { in __aafs_profile_mkdir()
1734 profile->label.proxy, NULL, NULL, in __aafs_profile_mkdir()
1738 aa_get_proxy(profile->label.proxy); in __aafs_profile_mkdir()
1739 profile->dents[AAFS_PROF_RAW_HASH] = dent; in __aafs_profile_mkdir()
1742 profile->label.proxy, NULL, NULL, in __aafs_profile_mkdir()
1746 aa_get_proxy(profile->label.proxy); in __aafs_profile_mkdir()
1747 profile->dents[AAFS_PROF_RAW_ABI] = dent; in __aafs_profile_mkdir()
1750 profile->label.proxy, NULL, NULL, in __aafs_profile_mkdir()
1754 aa_get_proxy(profile->label.proxy); in __aafs_profile_mkdir()
1755 profile->dents[AAFS_PROF_RAW_DATA] = dent; in __aafs_profile_mkdir()
1758 list_for_each_entry(child, &profile->base.profiles, base.list) { in __aafs_profile_mkdir()
1759 error = __aafs_profile_mkdir(child, prof_child_dir(profile)); in __aafs_profile_mkdir()
1770 __aafs_profile_rmdir(profile); in __aafs_profile_mkdir()
2163 struct aa_profile *profile) in next_profile() argument
2165 struct aa_profile *next = __next_profile(profile); in next_profile()
2170 return __first_profile(root, __next_ns(root, profile->ns)); in next_profile()
2184 struct aa_profile *profile = NULL; in p_start() local
2191 profile = __first_profile(root, root); in p_start()
2194 for (; profile && l > 0; l--) in p_start()
2195 profile = next_profile(root, profile); in p_start()
2197 return profile; in p_start()
2212 struct aa_profile *profile = p; in p_next() local
2216 return next_profile(ns, profile); in p_next()
2228 struct aa_profile *profile = p; in p_stop() local
2231 if (profile) { in p_stop()
2232 for (ns = profile->ns; ns && ns != root; ns = ns->parent) in p_stop()
2248 struct aa_profile *profile = (struct aa_profile *)p; in seq_show_profile() local
2251 aa_label_seq_xprint(f, root, &profile->label, in seq_show_profile()