Lines Matching full:new
38 * to trace the new domain
449 * The new match isn't more specific in find_attach()
561 struct aa_label *new = NULL; in x_to_label() local
576 new = x_table_lookup(profile, xindex, lookupname); in x_to_label()
584 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label()
588 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label()
594 if (!new) { in x_to_label()
601 new = aa_get_newest_label(&profile->label); in x_to_label()
603 new = aa_get_newest_label(ns_unconfined(profile->ns)); in x_to_label()
608 if (new && stack) { in x_to_label()
610 struct aa_label *base = new; in x_to_label()
612 new = aa_label_parse(base, stack, GFP_KERNEL, true, false); in x_to_label()
613 if (IS_ERR(new)) in x_to_label()
614 new = NULL; in x_to_label()
619 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()
657 AA_DEBUG("unconfined attached to new label"); 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()
803 struct aa_label *new; in handle_onexec() local
817 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
829 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
836 if (new) in handle_onexec()
837 return new; in handle_onexec()
849 * apparmor_bprm_creds_for_exec - Update the new creds on the bprm struct
859 struct aa_label *label, *new = NULL; in apparmor_bprm_creds_for_exec() local
879 * Detect no new privs being set, and store the label it in apparmor_bprm_creds_for_exec()
898 new = handle_onexec(label, ctx->onexec, ctx->token, in apparmor_bprm_creds_for_exec()
901 new = fn_label_build(label, profile, GFP_KERNEL, in apparmor_bprm_creds_for_exec()
905 AA_BUG(!new); in apparmor_bprm_creds_for_exec()
906 if (IS_ERR(new)) { in apparmor_bprm_creds_for_exec()
907 error = PTR_ERR(new); in apparmor_bprm_creds_for_exec()
909 } else if (!new) { in apparmor_bprm_creds_for_exec()
916 * of the confinement when the task entered no new privs. in apparmor_bprm_creds_for_exec()
924 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in apparmor_bprm_creds_for_exec()
926 info = "no new privs"; in apparmor_bprm_creds_for_exec()
936 /* TODO: test needs to be profile of label to new */ in apparmor_bprm_creds_for_exec()
937 error = may_change_ptraced_domain(new, &info); in apparmor_bprm_creds_for_exec()
946 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
952 if (label->proxy != new->proxy) { in apparmor_bprm_creds_for_exec()
957 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
964 set_cred_label(bprm->cred, new); in apparmor_bprm_creds_for_exec()
975 bprm->filename, NULL, new, in apparmor_bprm_creds_for_exec()
977 aa_put_label(new); in apparmor_bprm_creds_for_exec()
1042 struct aa_label *new; in change_hat() local
1122 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in change_hat()
1125 if (!new) { in change_hat()
1129 } /* else if (IS_ERR) build_change_hat has logged error so return new */ in change_hat()
1131 return new; in change_hat()
1155 struct aa_label *label, *previous, *new = NULL, *target = NULL; in aa_change_hat() local
1167 * Detect no new privs being set, and store the label it in aa_change_hat()
1183 new = change_hat(label, hats, count, flags); in aa_change_hat()
1184 AA_BUG(!new); in aa_change_hat()
1185 if (IS_ERR(new)) { in aa_change_hat()
1186 error = PTR_ERR(new); in aa_change_hat()
1187 new = NULL; in aa_change_hat()
1192 error = may_change_ptraced_domain(new, &info); in aa_change_hat()
1197 * no new privs prevents domain transitions that would in aa_change_hat()
1201 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_hat()
1211 target = new; in aa_change_hat()
1212 error = aa_set_current_hat(new, token); in aa_change_hat()
1218 * no new privs prevents domain transitions that would in aa_change_hat()
1242 aa_put_label(new); in aa_change_hat()
1290 * Change to new profile @name. Unlike with hats, there is no way
1300 struct aa_label *label, *new = NULL, *target = NULL; in aa_change_profile() local
1314 * Detect no new privs being set, and store the label it in aa_change_profile()
1411 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in aa_change_profile()
1415 * no new privs prevents domain transitions that would in aa_change_profile()
1419 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_profile()
1430 new = aa_label_merge(label, target, GFP_KERNEL); in aa_change_profile()
1431 if (IS_ERR_OR_NULL(new)) { in aa_change_profile()
1433 if (!new) in aa_change_profile()
1436 error = PTR_ERR(new); in aa_change_profile()
1437 new = NULL; in aa_change_profile()
1441 error = aa_replace_current_label(new); in aa_change_profile()
1443 if (new) { in aa_change_profile()
1444 aa_put_label(new); in aa_change_profile()
1445 new = NULL; in aa_change_profile()
1455 NULL, new ? new : target, in aa_change_profile()
1459 aa_put_label(new); in aa_change_profile()