Lines Matching refs:bprm
310 static int aa_xattrs_match(const struct linux_binprm *bprm, in aa_xattrs_match() argument
319 if (!bprm || !profile->xattr_count) in aa_xattrs_match()
325 d = bprm->file->f_path.dentry; in aa_xattrs_match()
387 static struct aa_label *find_attach(const struct linux_binprm *bprm, in find_attach() argument
430 if (bprm && profile->xattr_count) { in find_attach()
436 ret = aa_xattrs_match(bprm, profile, in find_attach()
557 const struct linux_binprm *bprm, in x_to_label() argument
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()
624 const struct linux_binprm *bprm, in profile_transition() argument
636 AA_BUG(!bprm); in profile_transition()
639 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_transition()
648 name = bprm->filename; in profile_transition()
653 new = find_attach(bprm, profile->ns, in profile_transition()
667 new = x_to_label(profile, bprm, name, perms.xindex, &target, in profile_transition()
722 bool stack, const struct linux_binprm *bprm, in profile_onexec() argument
733 AA_BUG(!bprm); in profile_onexec()
746 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_onexec()
754 xname = bprm->filename; in profile_onexec()
795 const struct linux_binprm *bprm, in handle_onexec() argument
805 AA_BUG(!bprm); in handle_onexec()
811 bprm, buffer, cond, unsafe)); in handle_onexec()
816 profile_transition(profile, bprm, buffer, in handle_onexec()
822 profile_onexec(profile, onexec, stack, bprm, in handle_onexec()
829 profile_transition(profile, bprm, buffer, in handle_onexec()
839 AA_MAY_ONEXEC, bprm->filename, NULL, in handle_onexec()
853 int apparmor_bprm_creds_for_exec(struct linux_binprm *bprm) in apparmor_bprm_creds_for_exec() argument
862 kuid_t i_uid = i_uid_into_mnt(file_mnt_user_ns(bprm->file), in apparmor_bprm_creds_for_exec()
863 file_inode(bprm->file)); in apparmor_bprm_creds_for_exec()
866 file_inode(bprm->file)->i_mode in apparmor_bprm_creds_for_exec()
870 AA_BUG(!cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec()
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()
896 bprm, buffer, &cond, &unsafe); in apparmor_bprm_creds_for_exec()
899 profile_transition(profile, bprm, buffer, in apparmor_bprm_creds_for_exec()
919 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && in apparmor_bprm_creds_for_exec()
927 if (bprm->unsafe & LSM_UNSAFE_SHARE) { in apparmor_bprm_creds_for_exec()
932 if (bprm->unsafe & (LSM_UNSAFE_PTRACE)) { in apparmor_bprm_creds_for_exec()
942 "label=", bprm->filename); in apparmor_bprm_creds_for_exec()
946 bprm->secureexec = 1; in apparmor_bprm_creds_for_exec()
953 "bits. %s label=", bprm->filename); in apparmor_bprm_creds_for_exec()
957 bprm->per_clear |= PER_CLEAR_ON_SETID; in apparmor_bprm_creds_for_exec()
959 aa_put_label(cred_label(bprm->cred)); 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()