Lines Matching full:new

55  * to trace the new domain
453 * 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()
627 struct aa_label *new = NULL; in profile_transition() local
645 new = aa_get_newest_label(&profile->label); in profile_transition()
652 new = find_attach(bprm, profile->ns, in profile_transition()
654 if (new) { in profile_transition()
655 AA_DEBUG("unconfined attached to new label"); in profile_transition()
656 return new; in profile_transition()
666 new = x_to_label(profile, bprm, name, perms.xindex, &target, in profile_transition()
668 if (new && new->proxy == profile->label.proxy && info) { in profile_transition()
671 } else if (!new) { in profile_transition()
688 new = &new_profile->label; in profile_transition()
695 if (!new) in profile_transition()
703 aa_label_printk(new, GFP_KERNEL); in profile_transition()
710 aa_audit_file(profile, &perms, OP_EXEC, MAY_EXEC, name, target, new, in profile_transition()
712 if (!new || nonewprivs) { in profile_transition()
713 aa_put_label(new); in profile_transition()
717 return new; in profile_transition()
799 struct aa_label *new; in handle_onexec() local
813 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
825 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in handle_onexec()
832 if (new) in handle_onexec()
833 return new; in handle_onexec()
845 * apparmor_bprm_creds_for_exec - Update the new creds on the bprm struct
855 struct aa_label *label, *new = NULL; in apparmor_bprm_creds_for_exec() local
873 * Detect no new privs being set, and store the label it 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()
899 AA_BUG(!new); in apparmor_bprm_creds_for_exec()
900 if (IS_ERR(new)) { in apparmor_bprm_creds_for_exec()
901 error = PTR_ERR(new); in apparmor_bprm_creds_for_exec()
903 } else if (!new) { in apparmor_bprm_creds_for_exec()
910 * of the confinement when the task entered no new privs. in apparmor_bprm_creds_for_exec()
918 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in apparmor_bprm_creds_for_exec()
920 info = "no new privs"; in apparmor_bprm_creds_for_exec()
930 /* TODO: test needs to be profile of label to new */ in apparmor_bprm_creds_for_exec()
931 error = may_change_ptraced_domain(new, &info); in apparmor_bprm_creds_for_exec()
940 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
946 if (label->proxy != new->proxy) { in apparmor_bprm_creds_for_exec()
951 aa_label_printk(new, GFP_KERNEL); in apparmor_bprm_creds_for_exec()
958 set_cred_label(bprm->cred, new); in apparmor_bprm_creds_for_exec()
969 bprm->filename, NULL, new, in apparmor_bprm_creds_for_exec()
972 aa_put_label(new); in apparmor_bprm_creds_for_exec()
1037 struct aa_label *new; in change_hat() local
1117 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in change_hat()
1120 if (!new) { in change_hat()
1124 } /* else if (IS_ERR) build_change_hat has logged error so return new */ in change_hat()
1126 return new; in change_hat()
1150 struct aa_label *label, *previous, *new = NULL, *target = NULL; in aa_change_hat() local
1162 * Detect no new privs being set, and store the label it in aa_change_hat()
1178 new = change_hat(label, hats, count, flags); in aa_change_hat()
1179 AA_BUG(!new); in aa_change_hat()
1180 if (IS_ERR(new)) { in aa_change_hat()
1181 error = PTR_ERR(new); in aa_change_hat()
1182 new = NULL; in aa_change_hat()
1187 error = may_change_ptraced_domain(new, &info); in aa_change_hat()
1192 * no new privs prevents domain transitions that would in aa_change_hat()
1196 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_hat()
1206 target = new; in aa_change_hat()
1207 error = aa_set_current_hat(new, token); in aa_change_hat()
1213 * no new privs prevents domain transitions that would in aa_change_hat()
1237 aa_put_label(new); in aa_change_hat()
1283 * Change to new profile @name. Unlike with hats, there is no way
1293 struct aa_label *label, *new = NULL, *target = NULL; in aa_change_profile() local
1307 * Detect no new privs being set, and store the label it in aa_change_profile()
1404 new = fn_label_build_in_ns(label, profile, GFP_KERNEL, in aa_change_profile()
1408 * no new privs prevents domain transitions that would in aa_change_profile()
1412 !aa_label_is_unconfined_subset(new, ctx->nnp)) { in aa_change_profile()
1423 new = aa_label_merge(label, target, GFP_KERNEL); in aa_change_profile()
1424 if (IS_ERR_OR_NULL(new)) { in aa_change_profile()
1426 if (!new) in aa_change_profile()
1429 error = PTR_ERR(new); in aa_change_profile()
1430 new = NULL; in aa_change_profile()
1434 error = aa_replace_current_label(new); in aa_change_profile()
1436 if (new) { in aa_change_profile()
1437 aa_put_label(new); in aa_change_profile()
1438 new = NULL; in aa_change_profile()
1448 NULL, new ? new : target, in aa_change_profile()
1452 aa_put_label(new); in aa_change_profile()