Lines Matching refs:label
134 struct aa_label *label, bool stack, in label_compound_match() argument
143 label_for_each(i, label, tp) { in label_compound_match()
157 label_for_each_cont(i, label, tp) { in label_compound_match()
194 struct aa_label *label, bool stack, in label_components_match() argument
205 label_for_each(i, label, tp) { in label_components_match()
221 label_for_each_cont(i, label, tp) { in label_components_match()
254 static int label_match(struct aa_profile *profile, struct aa_label *label, in label_match() argument
261 error = label_compound_match(profile, label, stack, state, subns, in label_match()
267 return label_components_match(profile, label, stack, state, subns, in label_match()
401 if (profile->label.flags & FLAG_NULL && in find_attach()
402 &profile->label == ns_unconfined(profile->ns)) in find_attach()
494 return &candidate->label; in find_attach()
513 struct aa_label *label = NULL; in x_table_lookup() local
523 for (*name = profile->file.trans.table[index]; !label && *name; in x_table_lookup()
530 label = &new_profile->label; in x_table_lookup()
533 label = aa_label_parse(&profile->label, *name, GFP_KERNEL, in x_table_lookup()
535 if (IS_ERR(label)) in x_table_lookup()
536 label = NULL; in x_table_lookup()
541 return label; in x_table_lookup()
602 new = aa_get_newest_label(&profile->label); in x_to_label()
643 (profile->label.flags & FLAG_IX_ON_NAME_ERROR)) { in profile_transition()
646 new = aa_get_newest_label(&profile->label); in profile_transition()
660 return aa_get_newest_label(&profile->label); in profile_transition()
669 if (new && new->proxy == profile->label.proxy && info) { in profile_transition()
689 new = &new_profile->label; in profile_transition()
750 (profile->label.flags & FLAG_IX_ON_NAME_ERROR)) { in profile_onexec()
793 static struct aa_label *handle_onexec(struct aa_label *label, in handle_onexec() argument
803 AA_BUG(!label); in handle_onexec()
809 error = fn_for_each_in_ns(label, profile, in handle_onexec()
814 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
821 error = fn_for_each_in_ns(label, profile, in handle_onexec()
826 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
827 aa_label_merge(&profile->label, onexec, in handle_onexec()
837 error = fn_for_each_in_ns(label, profile, in handle_onexec()
856 struct aa_label *label, *new = NULL; in apparmor_bprm_creds_for_exec() local
873 label = aa_get_newest_label(cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec()
882 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) && in apparmor_bprm_creds_for_exec()
884 ctx->nnp = aa_get_label(label); in apparmor_bprm_creds_for_exec()
895 new = handle_onexec(label, ctx->onexec, ctx->token, in apparmor_bprm_creds_for_exec()
898 new = fn_label_build(label, profile, GFP_KERNEL, in apparmor_bprm_creds_for_exec()
920 !unconfined(label) && in apparmor_bprm_creds_for_exec()
949 if (label->proxy != new->proxy) { in apparmor_bprm_creds_for_exec()
964 aa_put_label(label); in apparmor_bprm_creds_for_exec()
970 error = fn_for_each(label, profile, in apparmor_bprm_creds_for_exec()
1021 hat ? &hat->label : NULL, GLOBAL_ROOT_UID, info, in build_change_hat()
1028 return &hat->label; in build_change_hat()
1035 static struct aa_label *change_hat(struct aa_label *label, const char *hats[], in change_hat() argument
1045 AA_BUG(!label); in change_hat()
1049 if (PROFILE_IS_HAT(labels_profile(label))) in change_hat()
1055 label_for_each_in_ns(it, labels_ns(label), label, profile) { in change_hat()
1091 label_for_each_in_ns(it, labels_ns(label), label, profile) { in change_hat()
1102 label_for_each_in_ns(it, labels_ns(label), label, profile) { in change_hat()
1119 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in change_hat()
1121 aa_get_label(&profile->label)); in change_hat()
1152 struct aa_label *label, *previous, *new = NULL, *target = NULL; in aa_change_hat() local
1160 label = aa_get_newest_cred_label(cred); in aa_change_hat()
1170 if (task_no_new_privs(current) && !unconfined(label) && !ctx->nnp) in aa_change_hat()
1171 ctx->nnp = aa_get_label(label); in aa_change_hat()
1173 if (unconfined(label)) { in aa_change_hat()
1180 new = change_hat(label, hats, count, flags); in aa_change_hat()
1197 if (task_no_new_privs(current) && !unconfined(label) && in aa_change_hat()
1218 if (task_no_new_privs(current) && !unconfined(label) && in aa_change_hat()
1241 aa_put_label(label); in aa_change_hat()
1251 fn_for_each_in_ns(label, profile, in aa_change_hat()
1294 struct aa_label *label, *new = NULL, *target = NULL; in aa_change_profile() local
1305 label = aa_get_current_label(); in aa_change_profile()
1314 if (task_no_new_privs(current) && !unconfined(label) && !ctx->nnp) in aa_change_profile()
1315 ctx->nnp = aa_get_label(label); in aa_change_profile()
1318 aa_put_label(label); in aa_change_profile()
1342 target = aa_label_parse(label, fqname, GFP_KERNEL, true, false); in aa_change_profile()
1354 !COMPLAIN_MODE(labels_profile(label))) in aa_change_profile()
1357 tprofile = aa_new_null_profile(labels_profile(label), false, in aa_change_profile()
1364 target = &tprofile->label; in aa_change_profile()
1376 error = fn_for_each_in_ns(label, profile, in aa_change_profile()
1389 if (error && !fn_for_each_in_ns(label, profile, in aa_change_profile()
1405 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in aa_change_profile()
1407 aa_get_label(&profile->label)); in aa_change_profile()
1412 if (task_no_new_privs(current) && !unconfined(label) && in aa_change_profile()
1424 new = aa_label_merge(label, target, GFP_KERNEL); in aa_change_profile()
1447 error = fn_for_each_in_ns(label, profile, in aa_change_profile()
1455 aa_put_label(label); in aa_change_profile()