Lines Matching defs:bprm
306 * @bprm: binprm struct for the process to validate
312 static int aa_xattrs_match(const struct linux_binprm *bprm,
321 if (!bprm || !attach->xattr_count)
327 d = bprm->file->f_path.dentry;
375 * @bprm: binprm structure of transitioning task
390 static struct aa_label *find_attach(const struct linux_binprm *bprm,
437 if (bprm && attach->xattr_count) {
443 ret = aa_xattrs_match(bprm, profile,
559 * @bprm: binprm structure of transitioning task
570 const struct linux_binprm *bprm,
601 new = find_attach(bprm, ns, &profile->base.profiles,
605 new = find_attach(bprm, ns, &ns->base.profiles,
662 const struct linux_binprm *bprm,
676 AA_BUG(!bprm);
679 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer,
688 name = bprm->filename;
693 new = find_attach(bprm, profile->ns,
723 new = x_to_label(profile, bprm, name, perms.xindex, &target,
795 bool stack, const struct linux_binprm *bprm,
807 AA_BUG(!bprm);
820 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer,
828 xname = bprm->filename;
880 const struct linux_binprm *bprm,
890 AA_BUG(!bprm);
898 bprm, buffer, cond, unsafe));
906 profile_transition(subj_cred, profile, bprm,
916 AA_MAY_ONEXEC, bprm->filename, NULL,
924 * apparmor_bprm_creds_for_exec - Update the new creds on the bprm struct
925 * @bprm: binprm for the exec (NOT NULL)
931 int apparmor_bprm_creds_for_exec(struct linux_binprm *bprm)
941 vfsuid_t vfsuid = i_uid_into_vfsuid(file_mnt_idmap(bprm->file),
942 file_inode(bprm->file));
945 file_inode(bprm->file)->i_mode
950 AA_BUG(!cred_label(bprm->cred));
953 label = aa_get_newest_label(cred_label(bprm->cred));
962 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) &&
976 bprm, buffer, &cond, &unsafe);
979 profile_transition(subj_cred, profile, bprm,
996 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) &&
1004 if (bprm->unsafe & LSM_UNSAFE_SHARE) {
1009 if (bprm->unsafe & (LSM_UNSAFE_PTRACE)) {
1011 error = may_change_ptraced_domain(bprm->cred, new, &info);
1019 bprm->filename);
1023 bprm->secureexec = 1;
1030 bprm->filename);
1034 bprm->per_clear |= PER_CLEAR_ON_SETID;
1036 aa_put_label(cred_label(bprm->cred));
1038 set_cred_label(bprm->cred, new);
1050 bprm->filename, NULL, new,