Lines Matching refs:new
563 struct aa_label *new = NULL; in x_to_label() local
578 new = x_table_lookup(profile, xindex, lookupname); in x_to_label()
586 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label()
590 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label()
596 if (!new) { in x_to_label()
603 new = aa_get_newest_label(&profile->label); in x_to_label()
605 new = aa_get_newest_label(ns_unconfined(profile->ns)); in x_to_label()
610 if (new && stack) { in x_to_label()
612 struct aa_label *base = new; in x_to_label()
614 new = aa_label_parse(base, stack, GFP_KERNEL, true, false); in x_to_label()
615 if (IS_ERR(new)) in x_to_label()
616 new = NULL; in x_to_label()
621 return new; in x_to_label()
629 struct aa_label *new = NULL; in profile_transition() local
647 new = aa_get_newest_label(&profile->label); in profile_transition()
654 new = find_attach(bprm, profile->ns, in profile_transition()
656 if (new) { in profile_transition()
658 return new; in profile_transition()
668 new = x_to_label(profile, bprm, name, perms.xindex, &target, in profile_transition()
670 if (new && new->proxy == profile->label.proxy && info) { in profile_transition()
673 } else if (!new) { in profile_transition()
690 new = &new_profile->label; in profile_transition()
697 if (!new) in profile_transition()
705 aa_label_printk(new, GFP_KERNEL); in profile_transition()
712 aa_audit_file(profile, &perms, OP_EXEC, MAY_EXEC, name, target, new, in profile_transition()
714 if (!new || nonewprivs) { in profile_transition()
715 aa_put_label(new); in profile_transition()
719 return new; in profile_transition()
801 struct aa_label *new; in handle_onexec() local
815 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
827 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
834 if (new) in handle_onexec()
835 return new; in handle_onexec()
857 struct aa_label *label, *new = NULL; in apparmor_bprm_creds_for_exec() local
896 new = handle_onexec(label, ctx->onexec, ctx->token, in apparmor_bprm_creds_for_exec()
899 new = fn_label_build(label, profile, GFP_KERNEL, in apparmor_bprm_creds_for_exec()
903 AA_BUG(!new); in apparmor_bprm_creds_for_exec()
904 if (IS_ERR(new)) { in apparmor_bprm_creds_for_exec()
905 error = PTR_ERR(new); in apparmor_bprm_creds_for_exec()
907 } else if (!new) { in apparmor_bprm_creds_for_exec()
922 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in apparmor_bprm_creds_for_exec()
935 error = may_change_ptraced_domain(new, &info); in apparmor_bprm_creds_for_exec()
944 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
950 if (label->proxy != new->proxy) { in apparmor_bprm_creds_for_exec()
955 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
962 set_cred_label(bprm->cred, new); in apparmor_bprm_creds_for_exec()
973 bprm->filename, NULL, new, in apparmor_bprm_creds_for_exec()
975 aa_put_label(new); in apparmor_bprm_creds_for_exec()
1040 struct aa_label *new; in change_hat() local
1120 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in change_hat()
1123 if (!new) { in change_hat()
1129 return new; in change_hat()
1153 struct aa_label *label, *previous, *new = NULL, *target = NULL; in aa_change_hat() local
1181 new = change_hat(label, hats, count, flags); in aa_change_hat()
1182 AA_BUG(!new); in aa_change_hat()
1183 if (IS_ERR(new)) { in aa_change_hat()
1184 error = PTR_ERR(new); in aa_change_hat()
1185 new = NULL; in aa_change_hat()
1190 error = may_change_ptraced_domain(new, &info); in aa_change_hat()
1199 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_hat()
1209 target = new; in aa_change_hat()
1210 error = aa_set_current_hat(new, token); in aa_change_hat()
1240 aa_put_label(new); in aa_change_hat()
1296 struct aa_label *label, *new = NULL, *target = NULL; in aa_change_profile() local
1407 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in aa_change_profile()
1415 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_profile()
1426 new = aa_label_merge(label, target, GFP_KERNEL); in aa_change_profile()
1427 if (IS_ERR_OR_NULL(new)) { in aa_change_profile()
1429 if (!new) in aa_change_profile()
1432 error = PTR_ERR(new); in aa_change_profile()
1433 new = NULL; in aa_change_profile()
1437 error = aa_replace_current_label(new); in aa_change_profile()
1439 if (new) { in aa_change_profile()
1440 aa_put_label(new); in aa_change_profile()
1441 new = NULL; in aa_change_profile()
1451 NULL, new ? new : target, in aa_change_profile()
1455 aa_put_label(new); in aa_change_profile()