Lines Matching refs:profile

65 	struct aa_profile *profile = labels_profile(aa_current_raw_label());  in audit_iface()  local
77 return aa_audit(AUDIT_APPARMOR_STATUS, profile, &sa, audit_cb); in audit_iface()
534 static bool unpack_xattrs(struct aa_ext *e, struct aa_profile *profile) in unpack_xattrs() argument
544 profile->attach.xattr_count = size; in unpack_xattrs()
545 profile->attach.xattrs = kcalloc(size, sizeof(char *), GFP_KERNEL); in unpack_xattrs()
546 if (!profile->attach.xattrs) in unpack_xattrs()
549 if (!aa_unpack_strdup(e, &profile->attach.xattrs[i], NULL)) in unpack_xattrs()
805 struct aa_profile *profile = NULL; in unpack_profile() local
837 profile = aa_alloc_profile(name, NULL, GFP_KERNEL); in unpack_profile()
838 if (!profile) { in unpack_profile()
843 rules = list_first_entry(&profile->rules, typeof(*rules), list); in unpack_profile()
846 (void) aa_unpack_str(e, &profile->rename, "rename"); in unpack_profile()
849 (void) aa_unpack_str(e, &profile->attach.xmatch_str, "attach"); in unpack_profile()
852 error = unpack_pdb(e, &profile->attach.xmatch, false, false, &info); in unpack_profile()
859 if (profile->attach.xmatch.dfa) { in unpack_profile()
864 profile->attach.xmatch_len = tmp; in unpack_profile()
865 profile->attach.xmatch.start[AA_CLASS_XMATCH] = DFA_START; in unpack_profile()
866 if (!profile->attach.xmatch.perms) { in unpack_profile()
867 error = aa_compat_map_xmatch(&profile->attach.xmatch); in unpack_profile()
876 (void) aa_unpack_str(e, &profile->disconnected, "disconnected"); in unpack_profile()
887 profile->label.flags |= FLAG_HAT; in unpack_profile()
889 profile->label.flags |= FLAG_DEBUG1; in unpack_profile()
891 profile->label.flags |= FLAG_DEBUG2; in unpack_profile()
895 profile->mode = APPARMOR_COMPLAIN; in unpack_profile()
897 profile->mode = APPARMOR_ENFORCE; in unpack_profile()
899 profile->mode = APPARMOR_KILL; in unpack_profile()
901 profile->mode = APPARMOR_UNCONFINED; in unpack_profile()
902 profile->label.flags |= FLAG_UNCONFINED; in unpack_profile()
904 profile->mode = APPARMOR_USER; in unpack_profile()
911 profile->audit = AUDIT_ALL; in unpack_profile()
917 if (aa_unpack_u32(e, &profile->path_flags, "path_flags")) in unpack_profile()
918 profile->path_flags |= profile->label.flags & in unpack_profile()
922 profile->path_flags = PATH_MEDIATE_DELETED; in unpack_profile()
960 if (!unpack_xattrs(e, profile)) { in unpack_profile()
1042 profile->data = kzalloc(sizeof(*profile->data), GFP_KERNEL); in unpack_profile()
1043 if (!profile->data) { in unpack_profile()
1054 if (rhashtable_init(profile->data, &params)) { in unpack_profile()
1077 if (rhashtable_insert_fast(profile->data, &data->head, in unpack_profile()
1078 profile->data->p)) { in unpack_profile()
1097 return profile; in unpack_profile()
1107 if (profile) in unpack_profile()
1111 audit_iface(profile, NULL, name, info, e, error); in unpack_profile()
1112 aa_free_profile(profile); in unpack_profile()
1237 static int verify_profile(struct aa_profile *profile) in verify_profile() argument
1239 struct aa_ruleset *rules = list_first_entry(&profile->rules, in verify_profile()
1248 audit_iface(profile, NULL, NULL, in verify_profile()
1254 audit_iface(profile, NULL, NULL, in verify_profile()
1259 audit_iface(profile, NULL, NULL, in verify_profile()
1263 if (!verify_perms(&profile->attach.xmatch)) { in verify_profile()
1264 audit_iface(profile, NULL, NULL, in verify_profile()
1404 struct aa_profile *profile = NULL; in aa_unpack() local
1421 profile = unpack_profile(&e, &ns_name); in aa_unpack()
1422 if (IS_ERR(profile)) { in aa_unpack()
1423 error = PTR_ERR(profile); in aa_unpack()
1427 error = verify_profile(profile); in aa_unpack()
1432 error = aa_calc_profile_hash(profile, e.version, start, in aa_unpack()
1443 ent->new = profile; in aa_unpack()
1467 aa_put_profile(profile); in aa_unpack()