Lines Matching refs:profile

612 static void profile_query_cb(struct aa_profile *profile, struct aa_perms *perms,  in profile_query_cb()  argument
615 struct aa_ruleset *rules = list_first_entry(&profile->rules, in profile_query_cb()
620 if (profile_unconfined(profile)) in profile_query_cb()
640 aa_apply_modes_to_perms(profile, &tmp); in profile_query_cb()
670 struct aa_profile *profile; in query_data() local
705 label_for_each_confined(i, label, profile) { in query_data()
706 if (!profile->data) in query_data()
709 data = rhashtable_lookup_fast(profile->data, &key, in query_data()
710 profile->data->p); in query_data()
759 struct aa_profile *profile; in query_label() local
791 label_for_each_in_ns(i, labels_ns(label), label, profile) { in query_label()
792 profile_query_cb(profile, &perms, match_str, match_len); in query_label()
795 label_for_each(i, label, profile) { in query_label()
796 profile_query_cb(profile, &perms, match_str, match_len); in query_label()
1074 struct aa_profile *profile = labels_profile(label); in seq_profile_name_show() local
1075 seq_printf(seq, "%s\n", profile->base.name); in seq_profile_name_show()
1085 struct aa_profile *profile = labels_profile(label); in seq_profile_mode_show() local
1086 seq_printf(seq, "%s\n", aa_profile_mode_names[profile->mode]); in seq_profile_mode_show()
1096 struct aa_profile *profile = labels_profile(label); in seq_profile_attach_show() local
1097 if (profile->attach.xmatch_str) in seq_profile_attach_show()
1098 seq_printf(seq, "%s\n", profile->attach.xmatch_str); in seq_profile_attach_show()
1099 else if (profile->attach.xmatch.dfa) in seq_profile_attach_show()
1102 seq_printf(seq, "%s\n", profile->base.name); in seq_profile_attach_show()
1112 struct aa_profile *profile = labels_profile(label); in seq_profile_hash_show() local
1115 if (profile->hash) { in seq_profile_hash_show()
1117 seq_printf(seq, "%.2x", profile->hash[i]); in seq_profile_hash_show()
1164 struct aa_profile *profile; in seq_ns_nsstacked_show() local
1171 label_for_each(it, label, profile) in seq_ns_nsstacked_show()
1172 if (profile->ns != labels_ns(label)) { in seq_ns_nsstacked_show()
1520 void __aafs_profile_rmdir(struct aa_profile *profile) in __aafs_profile_rmdir() argument
1525 if (!profile) in __aafs_profile_rmdir()
1528 list_for_each_entry(child, &profile->base.profiles, base.list) in __aafs_profile_rmdir()
1533 if (!profile->dents[i]) in __aafs_profile_rmdir()
1536 proxy = d_inode(profile->dents[i])->i_private; in __aafs_profile_rmdir()
1537 aafs_remove(profile->dents[i]); in __aafs_profile_rmdir()
1539 profile->dents[i] = NULL; in __aafs_profile_rmdir()
1568 struct aa_profile *profile, in create_profile_file() argument
1571 struct aa_proxy *proxy = aa_get_proxy(profile->label.proxy); in create_profile_file()
1582 static int profile_depth(struct aa_profile *profile) in profile_depth() argument
1587 for (depth = 0; profile; profile = rcu_access_pointer(profile->parent)) in profile_depth()
1631 struct aa_profile *profile; in rawdata_get_link_base() local
1639 profile = labels_profile(label); in rawdata_get_link_base()
1640 depth = profile_depth(profile); in rawdata_get_link_base()
1641 target = gen_symlink_name(depth, profile->rawdata->name, name); in rawdata_get_link_base()
1688 int __aafs_profile_mkdir(struct aa_profile *profile, struct dentry *parent) in __aafs_profile_mkdir() argument
1694 AA_BUG(!profile); in __aafs_profile_mkdir()
1695 AA_BUG(!mutex_is_locked(&profiles_ns(profile)->lock)); in __aafs_profile_mkdir()
1699 p = aa_deref_parent(profile); in __aafs_profile_mkdir()
1708 if (!profile->dirname) { in __aafs_profile_mkdir()
1710 len = mangle_name(profile->base.name, NULL); in __aafs_profile_mkdir()
1711 id_len = snprintf(NULL, 0, ".%ld", profile->ns->uniq_id); in __aafs_profile_mkdir()
1713 profile->dirname = kmalloc(len + id_len + 1, GFP_KERNEL); in __aafs_profile_mkdir()
1714 if (!profile->dirname) { in __aafs_profile_mkdir()
1719 mangle_name(profile->base.name, profile->dirname); in __aafs_profile_mkdir()
1720 sprintf(profile->dirname + len, ".%ld", profile->ns->uniq_id++); in __aafs_profile_mkdir()
1723 dent = aafs_create_dir(profile->dirname, parent); in __aafs_profile_mkdir()
1726 prof_dir(profile) = dir = dent; in __aafs_profile_mkdir()
1728 dent = create_profile_file(dir, "name", profile, in __aafs_profile_mkdir()
1732 profile->dents[AAFS_PROF_NAME] = dent; in __aafs_profile_mkdir()
1734 dent = create_profile_file(dir, "mode", profile, in __aafs_profile_mkdir()
1738 profile->dents[AAFS_PROF_MODE] = dent; in __aafs_profile_mkdir()
1740 dent = create_profile_file(dir, "attach", profile, in __aafs_profile_mkdir()
1744 profile->dents[AAFS_PROF_ATTACH] = dent; in __aafs_profile_mkdir()
1746 if (profile->hash) { in __aafs_profile_mkdir()
1747 dent = create_profile_file(dir, "sha1", profile, in __aafs_profile_mkdir()
1751 profile->dents[AAFS_PROF_HASH] = dent; in __aafs_profile_mkdir()
1755 if (profile->rawdata) { in __aafs_profile_mkdir()
1758 profile->label.proxy, NULL, NULL, in __aafs_profile_mkdir()
1762 aa_get_proxy(profile->label.proxy); in __aafs_profile_mkdir()
1763 profile->dents[AAFS_PROF_RAW_HASH] = dent; in __aafs_profile_mkdir()
1766 profile->label.proxy, NULL, NULL, in __aafs_profile_mkdir()
1770 aa_get_proxy(profile->label.proxy); in __aafs_profile_mkdir()
1771 profile->dents[AAFS_PROF_RAW_ABI] = dent; in __aafs_profile_mkdir()
1774 profile->label.proxy, NULL, NULL, in __aafs_profile_mkdir()
1778 aa_get_proxy(profile->label.proxy); in __aafs_profile_mkdir()
1779 profile->dents[AAFS_PROF_RAW_DATA] = dent; in __aafs_profile_mkdir()
1783 list_for_each_entry(child, &profile->base.profiles, base.list) { in __aafs_profile_mkdir()
1784 error = __aafs_profile_mkdir(child, prof_child_dir(profile)); in __aafs_profile_mkdir()
1795 __aafs_profile_rmdir(profile); in __aafs_profile_mkdir()
2190 struct aa_profile *profile) in next_profile() argument
2192 struct aa_profile *next = __next_profile(profile); in next_profile()
2197 return __first_profile(root, __next_ns(root, profile->ns)); in next_profile()
2211 struct aa_profile *profile = NULL; in p_start() local
2218 profile = __first_profile(root, root); in p_start()
2221 for (; profile && l > 0; l--) in p_start()
2222 profile = next_profile(root, profile); in p_start()
2224 return profile; in p_start()
2239 struct aa_profile *profile = p; in p_next() local
2243 return next_profile(ns, profile); in p_next()
2255 struct aa_profile *profile = p; in p_stop() local
2258 if (profile) { in p_stop()
2259 for (ns = profile->ns; ns && ns != root; ns = ns->parent) in p_stop()
2275 struct aa_profile *profile = (struct aa_profile *)p; in seq_show_profile() local
2278 aa_label_seq_xprint(f, root, &profile->label, in seq_show_profile()