Lines Matching refs:bprm

303  * @bprm: binprm struct for the process to validate
309 static int aa_xattrs_match(const struct linux_binprm *bprm,
318 if (!bprm || !profile->xattr_count)
324 d = bprm->file->f_path.dentry;
371 * @bprm - binprm structure of transitioning task
386 static struct aa_label *find_attach(const struct linux_binprm *bprm,
429 if (bprm && profile->xattr_count) {
435 ret = aa_xattrs_match(bprm, profile,
546 * @bprm: binprm structure of transitioning task
556 const struct linux_binprm *bprm,
584 new = find_attach(bprm, ns, &profile->base.profiles,
588 new = find_attach(bprm, ns, &ns->base.profiles,
623 const struct linux_binprm *bprm,
635 AA_BUG(!bprm);
638 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer,
647 name = bprm->filename;
652 new = find_attach(bprm, profile->ns,
666 new = x_to_label(profile, bprm, name, perms.xindex, &target,
721 bool stack, const struct linux_binprm *bprm,
732 AA_BUG(!bprm);
745 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer,
753 xname = bprm->filename;
794 const struct linux_binprm *bprm,
804 AA_BUG(!bprm);
810 bprm, buffer, cond, unsafe));
815 profile_transition(profile, bprm, buffer,
821 profile_onexec(profile, onexec, stack, bprm,
828 profile_transition(profile, bprm, buffer,
838 AA_MAY_ONEXEC, bprm->filename, NULL,
845 * apparmor_bprm_creds_for_exec - Update the new creds on the bprm struct
846 * @bprm: binprm for the exec (NOT NULL)
852 int apparmor_bprm_creds_for_exec(struct linux_binprm *bprm)
862 file_inode(bprm->file)->i_uid,
863 file_inode(bprm->file)->i_mode
867 AA_BUG(!cred_label(bprm->cred));
870 label = aa_get_newest_label(cred_label(bprm->cred));
879 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) &&
893 bprm, buffer, &cond, &unsafe);
896 profile_transition(profile, bprm, buffer,
916 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) &&
924 if (bprm->unsafe & LSM_UNSAFE_SHARE) {
929 if (bprm->unsafe & (LSM_UNSAFE_PTRACE)) {
939 "label=", bprm->filename);
943 bprm->secureexec = 1;
950 "bits. %s label=", bprm->filename);
954 bprm->per_clear |= PER_CLEAR_ON_SETID;
956 aa_put_label(cred_label(bprm->cred));
958 set_cred_label(bprm->cred, new);
969 bprm->filename, NULL, new,
970 file_inode(bprm->file)->i_uid, info,