Lines Matching refs:profile
66 struct aa_profile *profile = labels_profile(aa_current_raw_label()); in audit_iface() local
78 return aa_audit(AUDIT_APPARMOR_STATUS, profile, &ad, 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()
820 struct aa_profile *profile = NULL; in unpack_profile() local
856 profile = aa_alloc_profile(name, NULL, GFP_KERNEL); in unpack_profile()
857 if (!profile) { in unpack_profile()
862 rules = list_first_entry(&profile->rules, typeof(*rules), list); in unpack_profile()
865 (void) aa_unpack_str(e, &profile->rename, "rename"); in unpack_profile()
868 (void) aa_unpack_str(e, &profile->attach.xmatch_str, "attach"); in unpack_profile()
871 error = unpack_pdb(e, &profile->attach.xmatch, false, false, &info); in unpack_profile()
878 if (profile->attach.xmatch->dfa) { in unpack_profile()
883 profile->attach.xmatch_len = tmp; in unpack_profile()
884 profile->attach.xmatch->start[AA_CLASS_XMATCH] = DFA_START; in unpack_profile()
885 if (!profile->attach.xmatch->perms) { in unpack_profile()
886 error = aa_compat_map_xmatch(profile->attach.xmatch); in unpack_profile()
896 profile->disconnected = disconnected; in unpack_profile()
907 profile->label.flags |= FLAG_HAT; in unpack_profile()
909 profile->label.flags |= FLAG_DEBUG1; in unpack_profile()
911 profile->label.flags |= FLAG_DEBUG2; in unpack_profile()
915 profile->mode = APPARMOR_COMPLAIN; in unpack_profile()
917 profile->mode = APPARMOR_ENFORCE; in unpack_profile()
919 profile->mode = APPARMOR_KILL; in unpack_profile()
921 profile->mode = APPARMOR_UNCONFINED; in unpack_profile()
922 profile->label.flags |= FLAG_UNCONFINED; in unpack_profile()
924 profile->mode = APPARMOR_USER; in unpack_profile()
931 profile->audit = AUDIT_ALL; in unpack_profile()
937 if (aa_unpack_u32(e, &profile->path_flags, "path_flags")) in unpack_profile()
938 profile->path_flags |= profile->label.flags & in unpack_profile()
942 profile->path_flags = PATH_MEDIATE_DELETED; in unpack_profile()
980 if (!unpack_xattrs(e, profile)) { in unpack_profile()
1045 profile->data = kzalloc(sizeof(*profile->data), GFP_KERNEL); in unpack_profile()
1046 if (!profile->data) { in unpack_profile()
1057 if (rhashtable_init(profile->data, ¶ms)) { in unpack_profile()
1080 if (rhashtable_insert_fast(profile->data, &data->head, in unpack_profile()
1081 profile->data->p)) { in unpack_profile()
1101 return profile; in unpack_profile()
1111 if (profile) in unpack_profile()
1115 audit_iface(profile, NULL, name, info, e, error); in unpack_profile()
1116 aa_free_profile(profile); in unpack_profile()
1241 static int verify_profile(struct aa_profile *profile) in verify_profile() argument
1243 struct aa_ruleset *rules = list_first_entry(&profile->rules, in verify_profile()
1250 audit_iface(profile, NULL, NULL, in verify_profile()
1257 audit_iface(profile, NULL, NULL, in verify_profile()
1264 audit_iface(profile, NULL, NULL, in verify_profile()
1269 audit_iface(profile, NULL, NULL, in verify_profile()
1273 if (!verify_perms(profile->attach.xmatch)) { in verify_profile()
1274 audit_iface(profile, NULL, NULL, in verify_profile()
1414 struct aa_profile *profile = NULL; in aa_unpack() local
1431 profile = unpack_profile(&e, &ns_name); in aa_unpack()
1432 if (IS_ERR(profile)) { in aa_unpack()
1433 error = PTR_ERR(profile); in aa_unpack()
1437 error = verify_profile(profile); in aa_unpack()
1442 error = aa_calc_profile_hash(profile, e.version, start, in aa_unpack()
1453 ent->new = profile; in aa_unpack()
1477 aa_put_profile(profile); in aa_unpack()