Lines Matching refs:label
9 * AppArmor allocates a unique secid for every label used. If a label
10 * is replaced it receives the secid of the label it is replacing.
23 #include "include/label.h"
27 * secids - do not pin labels with a refcount. They rely on the label
38 * TODO: use secid_update in label replace
42 * aa_secid_update - update a secid mapping to a new label
44 * @label: label the secid will now map to
46 void aa_secid_update(u32 secid, struct aa_label *label)
51 idr_replace(&aa_secids, label, secid);
57 * see label for inverse aa_label_to_secid
61 struct aa_label *label;
64 label = idr_find(&aa_secids, secid);
67 return label;
73 struct aa_label *label = aa_secid_to_label(secid);
78 if (!label)
82 len = aa_label_asxprint(secdata, root_ns, label,
87 len = aa_label_snxprint(NULL, 0, root_ns, label,
100 struct aa_label *label;
102 label = aa_label_strn_parse(&root_ns->unconfined->label, secdata,
104 if (IS_ERR(label))
105 return PTR_ERR(label);
106 *secid = label->secid;
118 * @label: the label to allocate a secid for
121 * Returns: 0 with @label->secid initialized
122 * <0 returns error with @label->secid set to AA_SECID_INVALID
124 int aa_alloc_secid(struct aa_label *label, gfp_t gfp)
131 ret = idr_alloc(&aa_secids, label, AA_FIRST_SECID, 0, GFP_ATOMIC);
136 label->secid = AA_SECID_INVALID;
141 label->secid = ret;