Lines Matching refs:new

562 	struct aa_label *new = NULL;  in x_to_label()  local
577 new = x_table_lookup(profile, xindex, lookupname); in x_to_label()
585 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label()
589 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label()
595 if (!new) { in x_to_label()
602 new = aa_get_newest_label(&profile->label); in x_to_label()
604 new = aa_get_newest_label(ns_unconfined(profile->ns)); in x_to_label()
609 if (new && stack) { in x_to_label()
611 struct aa_label *base = new; in x_to_label()
613 new = aa_label_parse(base, stack, GFP_KERNEL, true, false); in x_to_label()
614 if (IS_ERR(new)) in x_to_label()
615 new = NULL; in x_to_label()
620 return new; in x_to_label()
628 struct aa_label *new = NULL; in profile_transition() local
646 new = aa_get_newest_label(&profile->label); in profile_transition()
653 new = find_attach(bprm, profile->ns, in profile_transition()
655 if (new) { in profile_transition()
657 return new; in profile_transition()
667 new = x_to_label(profile, bprm, name, perms.xindex, &target, in profile_transition()
669 if (new && new->proxy == profile->label.proxy && info) { in profile_transition()
672 } else if (!new) { in profile_transition()
689 new = &new_profile->label; in profile_transition()
696 if (!new) in profile_transition()
704 aa_label_printk(new, GFP_KERNEL); in profile_transition()
711 aa_audit_file(profile, &perms, OP_EXEC, MAY_EXEC, name, target, new, in profile_transition()
713 if (!new || nonewprivs) { in profile_transition()
714 aa_put_label(new); in profile_transition()
718 return new; in profile_transition()
800 struct aa_label *new; in handle_onexec() local
814 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
826 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
833 if (new) in handle_onexec()
834 return new; in handle_onexec()
856 struct aa_label *label, *new = NULL; in apparmor_bprm_creds_for_exec() local
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()
902 AA_BUG(!new); in apparmor_bprm_creds_for_exec()
903 if (IS_ERR(new)) { in apparmor_bprm_creds_for_exec()
904 error = PTR_ERR(new); in apparmor_bprm_creds_for_exec()
906 } else if (!new) { in apparmor_bprm_creds_for_exec()
921 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in apparmor_bprm_creds_for_exec()
934 error = may_change_ptraced_domain(new, &info); in apparmor_bprm_creds_for_exec()
943 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
949 if (label->proxy != new->proxy) { in apparmor_bprm_creds_for_exec()
954 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
961 set_cred_label(bprm->cred, new); in apparmor_bprm_creds_for_exec()
972 bprm->filename, NULL, new, in apparmor_bprm_creds_for_exec()
974 aa_put_label(new); in apparmor_bprm_creds_for_exec()
1039 struct aa_label *new; in change_hat() local
1119 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in change_hat()
1122 if (!new) { in change_hat()
1128 return new; in change_hat()
1152 struct aa_label *label, *previous, *new = NULL, *target = NULL; in aa_change_hat() local
1180 new = change_hat(label, hats, count, flags); in aa_change_hat()
1181 AA_BUG(!new); in aa_change_hat()
1182 if (IS_ERR(new)) { in aa_change_hat()
1183 error = PTR_ERR(new); in aa_change_hat()
1184 new = NULL; in aa_change_hat()
1189 error = may_change_ptraced_domain(new, &info); in aa_change_hat()
1198 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_hat()
1208 target = new; in aa_change_hat()
1209 error = aa_set_current_hat(new, token); in aa_change_hat()
1239 aa_put_label(new); in aa_change_hat()
1294 struct aa_label *label, *new = NULL, *target = NULL; in aa_change_profile() local
1405 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in aa_change_profile()
1413 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_profile()
1424 new = aa_label_merge(label, target, GFP_KERNEL); in aa_change_profile()
1425 if (IS_ERR_OR_NULL(new)) { in aa_change_profile()
1427 if (!new) in aa_change_profile()
1430 error = PTR_ERR(new); in aa_change_profile()
1431 new = NULL; in aa_change_profile()
1435 error = aa_replace_current_label(new); in aa_change_profile()
1437 if (new) { in aa_change_profile()
1438 aa_put_label(new); in aa_change_profile()
1439 new = NULL; in aa_change_profile()
1449 NULL, new ? new : target, in aa_change_profile()
1453 aa_put_label(new); in aa_change_profile()