• Home
  • Raw
  • Download

Lines Matching refs:profile

448 			       struct aa_profile *profile)  in __list_add_profile()  argument
450 list_add(&profile->base.list, list); in __list_add_profile()
452 aa_get_profile(profile); in __list_add_profile()
467 static void __list_remove_profile(struct aa_profile *profile) in __list_remove_profile() argument
469 list_del_init(&profile->base.list); in __list_remove_profile()
470 if (!(profile->flags & PFLAG_NO_LIST_REF)) in __list_remove_profile()
472 aa_put_profile(profile); in __list_remove_profile()
523 static void __remove_profile(struct aa_profile *profile) in __remove_profile() argument
526 __profile_list_release(&profile->base.profiles); in __remove_profile()
528 profile->replacedby = aa_get_profile(profile->ns->unconfined); in __remove_profile()
529 __list_remove_profile(profile); in __remove_profile()
540 struct aa_profile *profile, *tmp; in __profile_list_release() local
541 list_for_each_entry_safe(profile, tmp, head, base.list) in __profile_list_release()
542 __remove_profile(profile); in __profile_list_release()
646 struct aa_profile *profile; in aa_alloc_profile() local
649 profile = kzalloc(sizeof(*profile), GFP_KERNEL); in aa_alloc_profile()
650 if (!profile) in aa_alloc_profile()
653 if (!policy_init(&profile->base, NULL, hname)) { in aa_alloc_profile()
654 kzfree(profile); in aa_alloc_profile()
659 return profile; in aa_alloc_profile()
678 struct aa_profile *profile = NULL; in aa_new_null_profile() local
688 profile = aa_alloc_profile(name); in aa_new_null_profile()
690 if (!profile) in aa_new_null_profile()
693 profile->sid = sid; in aa_new_null_profile()
694 profile->mode = APPARMOR_COMPLAIN; in aa_new_null_profile()
695 profile->flags = PFLAG_NULL; in aa_new_null_profile()
697 profile->flags |= PFLAG_HAT; in aa_new_null_profile()
700 profile->parent = aa_get_profile(parent); in aa_new_null_profile()
701 profile->ns = aa_get_namespace(parent->ns); in aa_new_null_profile()
703 write_lock(&profile->ns->lock); in aa_new_null_profile()
704 __list_add_profile(&parent->base.profiles, profile); in aa_new_null_profile()
705 write_unlock(&profile->ns->lock); in aa_new_null_profile()
708 return profile; in aa_new_null_profile()
725 static void free_profile(struct aa_profile *profile) in free_profile() argument
727 AA_DEBUG("%s(%p)\n", __func__, profile); in free_profile()
729 if (!profile) in free_profile()
732 if (!list_empty(&profile->base.list)) { in free_profile()
735 __func__, profile->base.name); in free_profile()
740 policy_destroy(&profile->base); in free_profile()
741 aa_put_profile(profile->parent); in free_profile()
743 aa_put_namespace(profile->ns); in free_profile()
744 kzfree(profile->rename); in free_profile()
746 aa_free_file_rules(&profile->file); in free_profile()
747 aa_free_cap_rules(&profile->caps); in free_profile()
748 aa_free_rlimit_rules(&profile->rlimits); in free_profile()
750 aa_free_sid(profile->sid); in free_profile()
751 aa_put_dfa(profile->xmatch); in free_profile()
752 aa_put_dfa(profile->policy.dfa); in free_profile()
754 aa_put_profile(profile->replacedby); in free_profile()
756 kzfree(profile); in free_profile()
812 struct aa_profile *profile; in aa_find_child() local
815 profile = aa_get_profile(__find_child(&parent->base.profiles, name)); in aa_find_child()
819 return profile; in aa_find_child()
839 struct aa_profile *profile = NULL; in __lookup_parent() local
845 profile = __strn_find_child(&policy->profiles, hname, in __lookup_parent()
847 if (!profile) in __lookup_parent()
849 policy = &profile->base; in __lookup_parent()
853 if (!profile) in __lookup_parent()
855 return &profile->base; in __lookup_parent()
872 struct aa_profile *profile = NULL; in __lookup_profile() local
876 profile = __strn_find_child(&base->profiles, hname, in __lookup_profile()
878 if (!profile) in __lookup_profile()
881 base = &profile->base; in __lookup_profile()
886 profile = __find_child(&base->profiles, hname); in __lookup_profile()
888 return profile; in __lookup_profile()
900 struct aa_profile *profile; in aa_lookup_profile() local
903 profile = aa_get_profile(__lookup_profile(&ns->base, hname)); in aa_lookup_profile()
907 return profile; in aa_lookup_profile()
918 static int replacement_allowed(struct aa_profile *profile, int noreplace, in replacement_allowed() argument
921 if (profile) { in replacement_allowed()
922 if (profile->flags & PFLAG_IMMUTABLE) { in replacement_allowed()
942 struct aa_profile *profile) in __add_new_profile() argument
946 profile->parent = aa_get_profile((struct aa_profile *) policy); in __add_new_profile()
947 __list_add_profile(&policy->profiles, profile); in __add_new_profile()
949 profile->sid = aa_alloc_sid(); in __add_new_profile()
950 profile->ns = aa_get_namespace(ns); in __add_new_profile()
1129 struct aa_profile *profile = NULL; in aa_remove_profiles() local
1165 profile = aa_get_profile(__lookup_profile(&ns->base, name)); in aa_remove_profiles()
1166 if (!profile) { in aa_remove_profiles()
1171 name = profile->base.hname; in aa_remove_profiles()
1172 __remove_profile(profile); in aa_remove_profiles()
1179 aa_put_profile(profile); in aa_remove_profiles()