• Home
  • Raw
  • Download

Lines Matching refs:profile

111 	struct aa_profile *profile = labels_profile(aa_current_raw_label());  in audit_iface()  local
123 return aa_audit(AUDIT_APPARMOR_STATUS, profile, &sa, audit_cb); in audit_iface()
449 static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) in unpack_trans_table() argument
461 profile->file.trans.table = kzalloc(sizeof(char *) * size, in unpack_trans_table()
463 if (!profile->file.trans.table) in unpack_trans_table()
466 profile->file.trans.size = size; in unpack_trans_table()
475 profile->file.trans.table[i] = str; in unpack_trans_table()
513 aa_free_domain_entries(&profile->file.trans); in unpack_trans_table()
518 static bool unpack_rlimits(struct aa_ext *e, struct aa_profile *profile) in unpack_rlimits() argument
528 profile->rlimits.mask = tmp; in unpack_rlimits()
538 profile->rlimits.limits[a].rlim_max = tmp2; in unpack_rlimits()
584 struct aa_profile *profile = NULL; in unpack_profile() local
615 profile = aa_alloc_profile(name, NULL, GFP_KERNEL); in unpack_profile()
616 if (!profile) in unpack_profile()
620 (void) unpack_str(e, &profile->rename, "rename"); in unpack_profile()
623 (void) unpack_str(e, &profile->attach, "attach"); in unpack_profile()
626 profile->xmatch = unpack_dfa(e); in unpack_profile()
627 if (IS_ERR(profile->xmatch)) { in unpack_profile()
628 error = PTR_ERR(profile->xmatch); in unpack_profile()
629 profile->xmatch = NULL; in unpack_profile()
634 if (profile->xmatch) { in unpack_profile()
639 profile->xmatch_len = tmp; in unpack_profile()
643 (void) unpack_str(e, &profile->disconnected, "disconnected"); in unpack_profile()
654 profile->label.flags |= FLAG_HAT; in unpack_profile()
658 profile->mode = APPARMOR_COMPLAIN; in unpack_profile()
660 profile->mode = APPARMOR_KILL; in unpack_profile()
662 profile->mode = APPARMOR_UNCONFINED; in unpack_profile()
666 profile->audit = AUDIT_ALL; in unpack_profile()
672 if (unpack_u32(e, &profile->path_flags, "path_flags")) in unpack_profile()
673 profile->path_flags |= profile->label.flags & in unpack_profile()
677 profile->path_flags = PATH_MEDIATE_DELETED; in unpack_profile()
680 if (!unpack_u32(e, &(profile->caps.allow.cap[0]), NULL)) in unpack_profile()
682 if (!unpack_u32(e, &(profile->caps.audit.cap[0]), NULL)) in unpack_profile()
684 if (!unpack_u32(e, &(profile->caps.quiet.cap[0]), NULL)) in unpack_profile()
692 if (!unpack_u32(e, &(profile->caps.allow.cap[1]), NULL)) in unpack_profile()
694 if (!unpack_u32(e, &(profile->caps.audit.cap[1]), NULL)) in unpack_profile()
696 if (!unpack_u32(e, &(profile->caps.quiet.cap[1]), NULL)) in unpack_profile()
707 if (!unpack_u32(e, &(profile->caps.extended.cap[0]), NULL)) in unpack_profile()
709 if (!unpack_u32(e, &(profile->caps.extended.cap[1]), NULL)) in unpack_profile()
715 if (!unpack_rlimits(e, profile)) { in unpack_profile()
723 profile->policy.dfa = unpack_dfa(e); in unpack_profile()
724 if (IS_ERR(profile->policy.dfa)) { in unpack_profile()
725 error = PTR_ERR(profile->policy.dfa); in unpack_profile()
726 profile->policy.dfa = NULL; in unpack_profile()
728 } else if (!profile->policy.dfa) { in unpack_profile()
732 if (!unpack_u32(e, &profile->policy.start[0], "start")) in unpack_profile()
734 profile->policy.start[0] = DFA_START; in unpack_profile()
737 profile->policy.start[i] = in unpack_profile()
738 aa_dfa_next(profile->policy.dfa, in unpack_profile()
739 profile->policy.start[0], in unpack_profile()
745 profile->policy.dfa = aa_get_dfa(nulldfa); in unpack_profile()
748 profile->file.dfa = unpack_dfa(e); in unpack_profile()
749 if (IS_ERR(profile->file.dfa)) { in unpack_profile()
750 error = PTR_ERR(profile->file.dfa); in unpack_profile()
751 profile->file.dfa = NULL; in unpack_profile()
754 } else if (profile->file.dfa) { in unpack_profile()
755 if (!unpack_u32(e, &profile->file.start, "dfa_start")) in unpack_profile()
757 profile->file.start = DFA_START; in unpack_profile()
758 } else if (profile->policy.dfa && in unpack_profile()
759 profile->policy.start[AA_CLASS_FILE]) { in unpack_profile()
760 profile->file.dfa = aa_get_dfa(profile->policy.dfa); in unpack_profile()
761 profile->file.start = profile->policy.start[AA_CLASS_FILE]; in unpack_profile()
763 profile->file.dfa = aa_get_dfa(nulldfa); in unpack_profile()
765 if (!unpack_trans_table(e, profile)) { in unpack_profile()
772 profile->data = kzalloc(sizeof(*profile->data), GFP_KERNEL); in unpack_profile()
773 if (!profile->data) in unpack_profile()
783 if (rhashtable_init(profile->data, &params)) { in unpack_profile()
804 rhashtable_insert_fast(profile->data, &data->head, in unpack_profile()
805 profile->data->p); in unpack_profile()
819 return profile; in unpack_profile()
822 if (profile) in unpack_profile()
826 audit_iface(profile, NULL, name, info, e, error); in unpack_profile()
827 aa_free_profile(profile); in unpack_profile()
911 static int verify_profile(struct aa_profile *profile) in verify_profile() argument
913 if (profile->file.dfa && in verify_profile()
914 !verify_dfa_xindex(profile->file.dfa, in verify_profile()
915 profile->file.trans.size)) { in verify_profile()
916 audit_iface(profile, NULL, NULL, "Invalid named transition", in verify_profile()
959 struct aa_profile *profile = NULL; in aa_unpack() local
976 profile = unpack_profile(&e, &ns_name); in aa_unpack()
977 if (IS_ERR(profile)) { in aa_unpack()
978 error = PTR_ERR(profile); in aa_unpack()
982 error = verify_profile(profile); in aa_unpack()
987 error = aa_calc_profile_hash(profile, e.version, start, in aa_unpack()
998 ent->new = profile; in aa_unpack()
1014 aa_put_profile(profile); in aa_unpack()