Lines Matching refs:bprm
309 static int aa_xattrs_match(const struct linux_binprm *bprm, in aa_xattrs_match() argument
318 if (!bprm || !profile->xattr_count) in aa_xattrs_match()
325 d = bprm->file->f_path.dentry; in aa_xattrs_match()
381 static struct aa_label *find_attach(const struct linux_binprm *bprm, in find_attach() argument
424 if (bprm && profile->xattr_count) { in find_attach()
430 ret = aa_xattrs_match(bprm, profile, in find_attach()
551 const struct linux_binprm *bprm, in x_to_label() argument
579 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label()
583 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label()
618 const struct linux_binprm *bprm, in profile_transition() argument
632 AA_BUG(!bprm); in profile_transition()
635 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_transition()
644 name = bprm->filename; in profile_transition()
649 new = find_attach(bprm, profile->ns, in profile_transition()
663 new = x_to_label(profile, bprm, name, perms.xindex, &target, in profile_transition()
678 if (aa_xattrs_match(bprm, component, state) < in profile_transition()
744 bool stack, const struct linux_binprm *bprm, in profile_onexec() argument
755 AA_BUG(!bprm); in profile_onexec()
768 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_onexec()
776 xname = bprm->filename; in profile_onexec()
817 const struct linux_binprm *bprm, in handle_onexec() argument
827 AA_BUG(!bprm); in handle_onexec()
833 bprm, buffer, cond, unsafe)); in handle_onexec()
838 profile_transition(profile, bprm, buffer, in handle_onexec()
844 profile_onexec(profile, onexec, stack, bprm, in handle_onexec()
851 profile_transition(profile, bprm, buffer, in handle_onexec()
861 AA_MAY_ONEXEC, bprm->filename, NULL, in handle_onexec()
875 int apparmor_bprm_set_creds(struct linux_binprm *bprm) in apparmor_bprm_set_creds() argument
885 file_inode(bprm->file)->i_uid, in apparmor_bprm_set_creds()
886 file_inode(bprm->file)->i_mode in apparmor_bprm_set_creds()
889 if (bprm->called_set_creds) in apparmor_bprm_set_creds()
893 AA_BUG(!cred_label(bprm->cred)); in apparmor_bprm_set_creds()
896 label = aa_get_newest_label(cred_label(bprm->cred)); in apparmor_bprm_set_creds()
905 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) && in apparmor_bprm_set_creds()
914 bprm, buffer, &cond, &unsafe); in apparmor_bprm_set_creds()
917 profile_transition(profile, bprm, buffer, in apparmor_bprm_set_creds()
937 if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && in apparmor_bprm_set_creds()
944 if (bprm->unsafe & LSM_UNSAFE_SHARE) { in apparmor_bprm_set_creds()
949 if (bprm->unsafe & (LSM_UNSAFE_PTRACE)) { in apparmor_bprm_set_creds()
959 "label=", bprm->filename); in apparmor_bprm_set_creds()
963 bprm->secureexec = 1; in apparmor_bprm_set_creds()
970 "bits. %s label=", bprm->filename); in apparmor_bprm_set_creds()
974 bprm->per_clear |= PER_CLEAR_ON_SETID; in apparmor_bprm_set_creds()
976 aa_put_label(cred_label(bprm->cred)); in apparmor_bprm_set_creds()
978 set_cred_label(bprm->cred, new); in apparmor_bprm_set_creds()
989 bprm->filename, NULL, new, in apparmor_bprm_set_creds()
990 file_inode(bprm->file)->i_uid, info, in apparmor_bprm_set_creds()