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"
37 * TODO: allow policy to reserve a secid range?
38 * TODO: add secid pinning
43 * aa_secid_update - update a secid mapping to a new label
44 * @secid: secid to update
45 * @label: label the secid will now map to
47 void aa_secid_update(u32 secid, struct aa_label *label)
52 __xa_store(&aa_secids, secid, label, 0);
59 struct aa_label *aa_secid_to_label(u32 secid)
61 return xa_load(&aa_secids, secid);
64 int apparmor_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
67 struct aa_label *label = aa_secid_to_label(secid);
93 int apparmor_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid)
101 *secid = label->secid;
112 * aa_alloc_secid - allocate a new secid for a profile
113 * @label: the label to allocate a secid for
116 * Returns: 0 with @label->secid initialized
117 * <0 returns error with @label->secid set to AA_SECID_INVALID
125 ret = __xa_alloc(&aa_secids, &label->secid, label,
130 label->secid = AA_SECID_INVALID;
138 * aa_free_secid - free a secid
139 * @secid: secid to free
141 void aa_free_secid(u32 secid)
146 __xa_erase(&aa_secids, secid);