Lines Matching refs:label
133 struct aa_label *label, bool stack, in label_compound_match() argument
142 label_for_each(i, label, tp) { in label_compound_match()
156 label_for_each_cont(i, label, tp) { in label_compound_match()
193 struct aa_label *label, bool stack, in label_components_match() argument
204 label_for_each(i, label, tp) { in label_components_match()
220 label_for_each_cont(i, label, tp) { in label_components_match()
253 static int label_match(struct aa_profile *profile, struct aa_label *label, in label_match() argument
260 error = label_compound_match(profile, label, stack, state, subns, in label_match()
266 return label_components_match(profile, label, stack, state, subns, in label_match()
400 if (profile->label.flags & FLAG_NULL && in find_attach()
401 &profile->label == ns_unconfined(profile->ns)) in find_attach()
493 return &candidate->label; in find_attach()
512 struct aa_label *label = NULL; in x_table_lookup() local
522 for (*name = profile->file.trans.table[index]; !label && *name; in x_table_lookup()
529 label = &new_profile->label; in x_table_lookup()
532 label = aa_label_parse(&profile->label, *name, GFP_KERNEL, in x_table_lookup()
534 if (IS_ERR(label)) in x_table_lookup()
535 label = NULL; in x_table_lookup()
540 return label; in x_table_lookup()
601 new = aa_get_newest_label(&profile->label); in x_to_label()
642 (profile->label.flags & FLAG_IX_ON_NAME_ERROR)) { in profile_transition()
645 new = aa_get_newest_label(&profile->label); in profile_transition()
659 return aa_get_newest_label(&profile->label); in profile_transition()
668 if (new && new->proxy == profile->label.proxy && info) { in profile_transition()
688 new = &new_profile->label; in profile_transition()
749 (profile->label.flags & FLAG_IX_ON_NAME_ERROR)) { in profile_onexec()
792 static struct aa_label *handle_onexec(struct aa_label *label, in handle_onexec() argument
802 AA_BUG(!label); in handle_onexec()
808 error = fn_for_each_in_ns(label, profile, in handle_onexec()
813 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
820 error = fn_for_each_in_ns(label, profile, in handle_onexec()
825 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
826 aa_label_merge(&profile->label, onexec, in handle_onexec()
836 error = fn_for_each_in_ns(label, profile, in handle_onexec()
855 struct aa_label *label, *new = NULL; in apparmor_bprm_creds_for_exec() local
870 label = aa_get_newest_label(cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec()
879 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) && in apparmor_bprm_creds_for_exec()
881 ctx->nnp = aa_get_label(label); in apparmor_bprm_creds_for_exec()
892 new = handle_onexec(label, ctx->onexec, ctx->token, in apparmor_bprm_creds_for_exec()
895 new = fn_label_build(label, profile, GFP_KERNEL, in apparmor_bprm_creds_for_exec()
917 !unconfined(label) && in apparmor_bprm_creds_for_exec()
946 if (label->proxy != new->proxy) { in apparmor_bprm_creds_for_exec()
961 aa_put_label(label); in apparmor_bprm_creds_for_exec()
967 error = fn_for_each(label, profile, in apparmor_bprm_creds_for_exec()
1019 hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info, in build_change_hat()
1026 return &hat->label; in build_change_hat()
1033 static struct aa_label *change_hat(struct aa_label *label, const char *hats[], in change_hat() argument
1043 AA_BUG(!label); in change_hat()
1047 if (PROFILE_IS_HAT(labels_profile(label))) in change_hat()
1053 label_for_each_in_ns(it, labels_ns(label), label, profile) { in change_hat()
1089 label_for_each_in_ns(it, labels_ns(label), label, profile) { in change_hat()
1100 label_for_each_in_ns(it, labels_ns(label), label, profile) { in change_hat()
1117 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in change_hat()
1119 aa_get_label(&profile->label)); in change_hat()
1150 struct aa_label *label, *previous, *new = NULL, *target = NULL; in aa_change_hat() local
1158 label = aa_get_newest_cred_label(cred); in aa_change_hat()
1168 if (task_no_new_privs(current) && !unconfined(label) && !ctx->nnp) in aa_change_hat()
1169 ctx->nnp = aa_get_label(label); in aa_change_hat()
1171 if (unconfined(label)) { in aa_change_hat()
1178 new = change_hat(label, hats, count, flags); in aa_change_hat()
1195 if (task_no_new_privs(current) && !unconfined(label) && in aa_change_hat()
1216 if (task_no_new_privs(current) && !unconfined(label) && in aa_change_hat()
1239 aa_put_label(label); in aa_change_hat()
1249 fn_for_each_in_ns(label, profile, in aa_change_hat()
1293 struct aa_label *label, *new = NULL, *target = NULL; in aa_change_profile() local
1304 label = aa_get_current_label(); in aa_change_profile()
1313 if (task_no_new_privs(current) && !unconfined(label) && !ctx->nnp) in aa_change_profile()
1314 ctx->nnp = aa_get_label(label); in aa_change_profile()
1317 aa_put_label(label); in aa_change_profile()
1341 target = aa_label_parse(label, fqname, GFP_KERNEL, true, false); in aa_change_profile()
1353 !COMPLAIN_MODE(labels_profile(label))) in aa_change_profile()
1356 tprofile = aa_new_null_profile(labels_profile(label), false, in aa_change_profile()
1363 target = &tprofile->label; in aa_change_profile()
1375 error = fn_for_each_in_ns(label, profile, in aa_change_profile()
1388 if (error && !fn_for_each_in_ns(label, profile, in aa_change_profile()
1404 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in aa_change_profile()
1406 aa_get_label(&profile->label)); in aa_change_profile()
1411 if (task_no_new_privs(current) && !unconfined(label) && in aa_change_profile()
1423 new = aa_label_merge(label, target, GFP_KERNEL); in aa_change_profile()
1446 error = fn_for_each_in_ns(label, profile, in aa_change_profile()
1454 aa_put_label(label); in aa_change_profile()