Lines Matching refs:bprm
298 static int aa_xattrs_match(const struct linux_binprm *bprm, in aa_xattrs_match() argument
307 if (!bprm || !attach->xattr_count) in aa_xattrs_match()
313 d = bprm->file->f_path.dentry; in aa_xattrs_match()
377 static struct aa_label *find_attach(const struct linux_binprm *bprm, in find_attach() argument
425 if (bprm && attach->xattr_count) { in find_attach()
431 ret = aa_xattrs_match(bprm, profile, in find_attach()
554 const struct linux_binprm *bprm, in x_to_label() argument
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()
623 const struct linux_binprm *bprm, in profile_transition() argument
637 AA_BUG(!bprm); in profile_transition()
640 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_transition()
649 name = bprm->filename; in profile_transition()
654 new = find_attach(bprm, profile->ns, in profile_transition()
668 new = x_to_label(profile, bprm, name, perms.xindex, &target, in profile_transition()
723 bool stack, const struct linux_binprm *bprm, in profile_onexec() argument
736 AA_BUG(!bprm); in profile_onexec()
749 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_onexec()
757 xname = bprm->filename; in profile_onexec()
798 const struct linux_binprm *bprm, in handle_onexec() argument
808 AA_BUG(!bprm); in handle_onexec()
814 bprm, buffer, cond, unsafe)); in handle_onexec()
819 profile_transition(profile, bprm, buffer, in handle_onexec()
825 profile_onexec(profile, onexec, stack, bprm, in handle_onexec()
832 profile_transition(profile, bprm, buffer, in handle_onexec()
842 AA_MAY_ONEXEC, bprm->filename, NULL, in handle_onexec()
856 int apparmor_bprm_creds_for_exec(struct linux_binprm *bprm) in apparmor_bprm_creds_for_exec() argument
865 vfsuid_t vfsuid = i_uid_into_vfsuid(file_mnt_idmap(bprm->file), in apparmor_bprm_creds_for_exec()
866 file_inode(bprm->file)); in apparmor_bprm_creds_for_exec()
869 file_inode(bprm->file)->i_mode in apparmor_bprm_creds_for_exec()
873 AA_BUG(!cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec()
876 label = aa_get_newest_label(cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec()
885 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) && in apparmor_bprm_creds_for_exec()
899 bprm, buffer, &cond, &unsafe); in apparmor_bprm_creds_for_exec()
902 profile_transition(profile, bprm, buffer, in apparmor_bprm_creds_for_exec()
922 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && in apparmor_bprm_creds_for_exec()
930 if (bprm->unsafe & LSM_UNSAFE_SHARE) { in apparmor_bprm_creds_for_exec()
935 if (bprm->unsafe & (LSM_UNSAFE_PTRACE)) { in apparmor_bprm_creds_for_exec()
945 "label=", bprm->filename); in apparmor_bprm_creds_for_exec()
949 bprm->secureexec = 1; in apparmor_bprm_creds_for_exec()
956 "bits. %s label=", bprm->filename); in apparmor_bprm_creds_for_exec()
960 bprm->per_clear |= PER_CLEAR_ON_SETID; in apparmor_bprm_creds_for_exec()
962 aa_put_label(cred_label(bprm->cred)); 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()