Lines Matching refs:secid
5 * This file contains AppArmor security identifier (secid) manipulation fns
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.
22 #include "include/secid.h"
36 * TODO: allow policy to reserve a secid range?
37 * TODO: add secid pinning
42 * aa_secid_update - update a secid mapping to a new label
43 * @secid: secid to update
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);
59 struct aa_label *aa_secid_to_label(u32 secid)
64 label = idr_find(&aa_secids, secid);
70 int apparmor_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
73 struct aa_label *label = aa_secid_to_label(secid);
98 int apparmor_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid)
106 *secid = label->secid;
117 * aa_alloc_secid - allocate a new secid for a profile
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
136 label->secid = AA_SECID_INVALID;
141 label->secid = ret;
146 * aa_free_secid - free a secid
147 * @secid: secid to free
149 void aa_free_secid(u32 secid)
154 idr_remove(&aa_secids, secid);