Lines Matching refs:profile

95 	struct aa_profile *profile = __aa_current_profile();  in audit_iface()  local
107 return aa_audit(AUDIT_APPARMOR_STATUS, profile, GFP_KERNEL, &sa, in audit_iface()
372 static bool unpack_trans_table(struct aa_ext *e, struct aa_profile *profile) in unpack_trans_table() argument
384 profile->file.trans.table = kzalloc(sizeof(char *) * size, in unpack_trans_table()
386 if (!profile->file.trans.table) in unpack_trans_table()
389 profile->file.trans.size = size; in unpack_trans_table()
398 profile->file.trans.table[i] = str; in unpack_trans_table()
430 aa_free_domain_entries(&profile->file.trans); in unpack_trans_table()
435 static bool unpack_rlimits(struct aa_ext *e, struct aa_profile *profile) in unpack_rlimits() argument
445 profile->rlimits.mask = tmp; in unpack_rlimits()
455 profile->rlimits.limits[a].rlim_max = tmp2; in unpack_rlimits()
477 struct aa_profile *profile = NULL; in unpack_profile() local
489 profile = aa_alloc_profile(name); in unpack_profile()
490 if (!profile) in unpack_profile()
494 (void) unpack_str(e, &profile->rename, "rename"); in unpack_profile()
497 (void) unpack_str(e, &profile->attach, "attach"); in unpack_profile()
500 profile->xmatch = unpack_dfa(e); in unpack_profile()
501 if (IS_ERR(profile->xmatch)) { in unpack_profile()
502 error = PTR_ERR(profile->xmatch); in unpack_profile()
503 profile->xmatch = NULL; in unpack_profile()
507 if (profile->xmatch) { in unpack_profile()
510 profile->xmatch_len = tmp; in unpack_profile()
519 profile->flags |= PFLAG_HAT; in unpack_profile()
523 profile->mode = APPARMOR_COMPLAIN; in unpack_profile()
525 profile->mode = APPARMOR_KILL; in unpack_profile()
527 profile->mode = APPARMOR_UNCONFINED; in unpack_profile()
531 profile->audit = AUDIT_ALL; in unpack_profile()
537 if (unpack_u32(e, &profile->path_flags, "path_flags")) in unpack_profile()
538 profile->path_flags |= profile->flags & PFLAG_MEDIATE_DELETED; in unpack_profile()
541 profile->path_flags = PFLAG_MEDIATE_DELETED; in unpack_profile()
543 if (!unpack_u32(e, &(profile->caps.allow.cap[0]), NULL)) in unpack_profile()
545 if (!unpack_u32(e, &(profile->caps.audit.cap[0]), NULL)) in unpack_profile()
547 if (!unpack_u32(e, &(profile->caps.quiet.cap[0]), NULL)) in unpack_profile()
554 if (!unpack_u32(e, &(profile->caps.allow.cap[1]), NULL)) in unpack_profile()
556 if (!unpack_u32(e, &(profile->caps.audit.cap[1]), NULL)) in unpack_profile()
558 if (!unpack_u32(e, &(profile->caps.quiet.cap[1]), NULL)) in unpack_profile()
568 if (!unpack_u32(e, &(profile->caps.extended.cap[0]), NULL)) in unpack_profile()
570 if (!unpack_u32(e, &(profile->caps.extended.cap[1]), NULL)) in unpack_profile()
576 if (!unpack_rlimits(e, profile)) in unpack_profile()
581 profile->policy.dfa = unpack_dfa(e); in unpack_profile()
582 if (IS_ERR(profile->policy.dfa)) { in unpack_profile()
583 error = PTR_ERR(profile->policy.dfa); in unpack_profile()
584 profile->policy.dfa = NULL; in unpack_profile()
587 if (!unpack_u32(e, &profile->policy.start[0], "start")) in unpack_profile()
589 profile->policy.start[0] = DFA_START; in unpack_profile()
592 profile->policy.start[i] = in unpack_profile()
593 aa_dfa_next(profile->policy.dfa, in unpack_profile()
594 profile->policy.start[0], in unpack_profile()
602 profile->file.dfa = unpack_dfa(e); in unpack_profile()
603 if (IS_ERR(profile->file.dfa)) { in unpack_profile()
604 error = PTR_ERR(profile->file.dfa); in unpack_profile()
605 profile->file.dfa = NULL; in unpack_profile()
609 if (!unpack_u32(e, &profile->file.start, "dfa_start")) in unpack_profile()
611 profile->file.start = DFA_START; in unpack_profile()
613 if (!unpack_trans_table(e, profile)) in unpack_profile()
619 return profile; in unpack_profile()
622 if (profile) in unpack_profile()
626 audit_iface(profile, name, "failed to unpack profile", e, error); in unpack_profile()
627 aa_free_profile(profile); in unpack_profile()
703 static int verify_profile(struct aa_profile *profile) in verify_profile() argument
706 if (profile->file.dfa && in verify_profile()
707 !verify_dfa_xindex(profile->file.dfa, in verify_profile()
708 profile->file.trans.size)) { in verify_profile()
709 audit_iface(profile, NULL, "Invalid named transition", in verify_profile()
752 struct aa_profile *profile = NULL; in aa_unpack() local
768 profile = unpack_profile(&e); in aa_unpack()
769 if (IS_ERR(profile)) { in aa_unpack()
770 error = PTR_ERR(profile); in aa_unpack()
774 error = verify_profile(profile); in aa_unpack()
778 error = aa_calc_profile_hash(profile, e.version, start, in aa_unpack()
789 ent->new = profile; in aa_unpack()
796 aa_put_profile(profile); in aa_unpack()