Lines Matching refs:secattr

3812  * @secattr: the NetLabel packet security attributes
3817 * @skb, in the NetLabel subsystem cache. This function assumes @secattr has
3821 static void security_netlbl_cache_add(struct netlbl_lsm_secattr *secattr,
3829 secattr->cache = netlbl_secattr_cache_alloc(GFP_ATOMIC);
3830 if (secattr->cache == NULL) {
3836 secattr->cache->free = kfree;
3837 secattr->cache->data = sid_cache;
3838 secattr->flags |= NETLBL_SECATTR_CACHE;
3842 * security_netlbl_secattr_to_sid - Convert a NetLabel secattr to a SELinux SID
3843 * @secattr: the NetLabel packet security attributes
3847 * Convert the given NetLabel security attributes in @secattr into a
3848 * SELinux SID. If the @secattr field does not contain a full SELinux
3850 * 'cache' field of @secattr is set and the CACHE flag is set; this is to
3851 * allow the @secattr to be used by NetLabel to cache the secattr to SID
3857 struct netlbl_lsm_secattr *secattr,
3879 if (secattr->flags & NETLBL_SECATTR_CACHE)
3880 *sid = *(u32 *)secattr->cache->data;
3881 else if (secattr->flags & NETLBL_SECATTR_SECID)
3882 *sid = secattr->attr.secid;
3883 else if (secattr->flags & NETLBL_SECATTR_MLS_LVL) {
3893 mls_import_netlbl_lvl(policydb, &ctx_new, secattr);
3894 if (secattr->flags & NETLBL_SECATTR_MLS_CAT) {
3895 rc = mls_import_netlbl_cat(policydb, &ctx_new, secattr);
3914 security_netlbl_cache_add(secattr, *sid);
3924 * security_netlbl_sid_to_secattr - Convert a SELinux SID to a NetLabel secattr
3926 * @secattr: the NetLabel packet security attributes
3934 u32 sid, struct netlbl_lsm_secattr *secattr)
3954 secattr->domain = kstrdup(sym_name(policydb, SYM_TYPES, ctx->type - 1),
3956 if (secattr->domain == NULL)
3959 secattr->attr.secid = sid;
3960 secattr->flags |= NETLBL_SECATTR_DOMAIN_CPY | NETLBL_SECATTR_SECID;
3961 mls_export_netlbl_lvl(policydb, ctx, secattr);
3962 rc = mls_export_netlbl_cat(policydb, ctx, secattr);