Home
last modified time | relevance | path

Searched refs:bprm (Results 1 – 25 of 84) sorted by relevance

1234

/openbmc/linux/fs/
H A Dexec.c79 static int bprm_creds_from_file(struct linux_binprm *bprm);
183 static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) in acct_arg_size() argument
186 long diff = (long)(pages - bprm->vma_pages); in acct_arg_size()
191 bprm->vma_pages = pages; in acct_arg_size()
195 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, in get_arg_page() argument
199 struct vm_area_struct *vma = bprm->vma; in get_arg_page()
200 struct mm_struct *mm = bprm->mm; in get_arg_page()
231 acct_arg_size(bprm, vma_pages(vma)); in get_arg_page()
241 static void free_arg_pages(struct linux_binprm *bprm) in free_arg_pages() argument
245 static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, in flush_arg_page() argument
[all …]
H A Dbinfmt_script.c34 static int load_script(struct linux_binprm *bprm) in load_script() argument
41 if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) in load_script()
58 buf_end = bprm->buf + sizeof(bprm->buf) - 1; in load_script()
59 i_end = strnchr(bprm->buf, sizeof(bprm->buf), '\n'); in load_script()
61 i_end = next_non_spacetab(bprm->buf + 2, buf_end); in load_script()
77 i_name = next_non_spacetab(bprm->buf+2, i_end); in load_script()
93 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_script()
106 retval = remove_arg_zero(bprm); in load_script()
109 retval = copy_string_kernel(bprm->interp, bprm); in load_script()
112 bprm->argc++; in load_script()
[all …]
H A Dbinfmt_flat.c108 static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start) in create_flat_tables() argument
117 sp -= bprm->envc + 1; in create_flat_tables()
118 sp -= bprm->argc + 1; in create_flat_tables()
126 if (put_user(bprm->argc, sp++)) in create_flat_tables()
131 envp = (unsigned long)(sp + 2 + bprm->argc + 1); in create_flat_tables()
137 for (i = bprm->argc; i > 0; i--) { in create_flat_tables()
150 for (i = bprm->envc; i > 0; i--) { in create_flat_tables()
182 static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst, in decompress_exec() argument
203 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec()
273 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec()
[all …]
H A Dbinfmt_misc.c94 static Node *search_binfmt_handler(struct linux_binprm *bprm) in search_binfmt_handler() argument
96 char *p = strrchr(bprm->interp, '.'); in search_binfmt_handler()
116 s = bprm->buf + e->offset; in search_binfmt_handler()
143 static Node *get_binfmt_handler(struct linux_binprm *bprm) in get_binfmt_handler() argument
148 e = search_binfmt_handler(bprm); in get_binfmt_handler()
175 static int load_misc_binary(struct linux_binprm *bprm) in load_misc_binary() argument
185 fmt = get_binfmt_handler(bprm); in load_misc_binary()
191 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_misc_binary()
195 bprm->interp_flags |= BINPRM_FLAGS_PRESERVE_ARGV0; in load_misc_binary()
197 retval = remove_arg_zero(bprm); in load_misc_binary()
[all …]
H A Dbinfmt_elf_fdpic.c182 static int load_elf_fdpic_binary(struct linux_binprm *bprm) in load_elf_fdpic_binary() argument
205 exec_params.hdr = *(struct elfhdr *) bprm->buf; in load_elf_fdpic_binary()
210 if (!is_elf(&exec_params.hdr, bprm->file)) in load_elf_fdpic_binary()
224 retval = elf_fdpic_fetch_phdrs(&exec_params, bprm->file); in load_elf_fdpic_binary()
247 retval = kernel_read(bprm->file, interpreter_name, in load_elf_fdpic_binary()
274 would_dump(bprm, interpreter); in load_elf_fdpic_binary()
277 retval = kernel_read(interpreter, bprm->buf, in load_elf_fdpic_binary()
285 interp_params.hdr = *((struct elfhdr *) bprm->buf); in load_elf_fdpic_binary()
341 retval = begin_new_exec(bprm); in load_elf_fdpic_binary()
354 setup_new_exec(bprm); in load_elf_fdpic_binary()
[all …]
H A Dbinfmt_elf.c69 static int load_elf_binary(struct linux_binprm *bprm);
175 create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, in create_elf_tables() argument
180 unsigned long p = bprm->p; in create_elf_tables()
181 int argc = bprm->argc; in create_elf_tables()
182 int envc = bprm->envc; in create_elf_tables()
267 if (bprm->interp_flags & BINPRM_FLAGS_PRESERVE_ARGV0) in create_elf_tables()
275 NEW_AUX_ENT(AT_SECURE, bprm->secureexec); in create_elf_tables()
280 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_tables()
289 if (bprm->have_execfd) { in create_elf_tables()
290 NEW_AUX_ENT(AT_EXECFD, bprm->execfd); in create_elf_tables()
[all …]
/openbmc/qemu/bsd-user/
H A Dbsdload.c48 static int prepare_binprm(struct bsd_binprm *bprm) in prepare_binprm() argument
54 if (fstat(bprm->fd, &st) < 0) { in prepare_binprm()
66 bprm->e_uid = geteuid(); in prepare_binprm()
67 bprm->e_gid = getegid(); in prepare_binprm()
71 bprm->e_uid = st.st_uid; in prepare_binprm()
81 bprm->e_gid = st.st_gid; in prepare_binprm()
84 memset(bprm->buf, 0, sizeof(bprm->buf)); in prepare_binprm()
85 retval = lseek(bprm->fd, 0L, SEEK_SET); in prepare_binprm()
87 retval = read(bprm->fd, bprm->buf, 128); in prepare_binprm()
149 struct bsd_binprm *bprm) in loader_exec() argument
[all …]
H A Delfload.c183 static void setup_arg_pages(struct bsd_binprm *bprm, struct image_info *info, in setup_arg_pages() argument
207 if (setup_initial_stack(bprm, stackp, stringp) != 0) { in setup_arg_pages()
600 int load_elf_binary(struct bsd_binprm *bprm, struct target_pt_regs *regs, in load_elf_binary() argument
617 elf_ex = *((struct elfhdr *) bprm->buf); /* exec-header */ in load_elf_binary()
626 bprm->p = copy_elf_strings(1, &bprm->filename, bprm->page, bprm->p); in load_elf_binary()
627 bprm->p = copy_elf_strings(bprm->envc, bprm->envp, bprm->page, bprm->p); in load_elf_binary()
628 bprm->p = copy_elf_strings(bprm->argc, bprm->argv, bprm->page, bprm->p); in load_elf_binary()
629 if (!bprm->p) { in load_elf_binary()
639 retval = lseek(bprm->fd, elf_ex.e_phoff, SEEK_SET); in load_elf_binary()
641 retval = read(bprm->fd, (char *)elf_phdata, in load_elf_binary()
[all …]
H A Dmain.c263 struct bsd_binprm bprm; in main() local
440 memset(&bprm, 0, sizeof(bprm)); in main()
573 &bprm) != 0) { in main()
612 ts->bprm = &bprm; in main()
/openbmc/qemu/linux-user/
H A Dlinuxload.c36 static int prepare_binprm(struct linux_binprm *bprm) in prepare_binprm() argument
42 if (fstat(bprm->src.fd, &st) < 0) { in prepare_binprm()
54 bprm->e_uid = geteuid(); in prepare_binprm()
55 bprm->e_gid = getegid(); in prepare_binprm()
59 bprm->e_uid = st.st_uid; in prepare_binprm()
69 bprm->e_gid = st.st_gid; in prepare_binprm()
72 retval = read(bprm->src.fd, bprm->buf, BPRM_BUF_SIZE); in prepare_binprm()
79 memset(bprm->buf + retval, 0, BPRM_BUF_SIZE - retval); in prepare_binprm()
82 bprm->src.cache = bprm->buf; in prepare_binprm()
83 bprm->src.cache_size = retval; in prepare_binprm()
[all …]
H A Dflatload.c192 static int load_flat_file(struct linux_binprm * bprm, in load_flat_file() argument
207 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ in load_flat_file()
221 DBG_FLT("BINFMT_FLAT: Loading file: %s\n", bprm->filename); in load_flat_file()
262 probe_guest_base(bprm->filename, 0, in load_flat_file()
278 MAP_PRIVATE, bprm->src.fd, 0); in load_flat_file()
298 result = target_pread(bprm->src.fd, datapos, in load_flat_file()
322 result = target_pread(bprm->src.fd, textpos, in load_flat_file()
325 result = target_pread(bprm->src.fd, datapos, in load_flat_file()
343 id ? "Lib" : "Load", bprm->filename, in load_flat_file()
459 int load_flt_binary(struct linux_binprm *bprm, struct image_info *info) in load_flt_binary() argument
[all …]
/openbmc/qemu/bsd-user/freebsd/
H A Dtarget_os_stack.h48 static inline int setup_initial_stack(struct bsd_binprm *bprm, in setup_initial_stack() argument
70 if (bprm->fullpath) { in setup_initial_stack()
71 execpath_len = strlen(bprm->fullpath) + 1; in setup_initial_stack()
73 if (memcpy_to_target(p, bprm->fullpath, execpath_len)) { in setup_initial_stack()
102 for (i = 0; i < bprm->argc; ++i) { in setup_initial_stack()
103 stringspace += strlen(bprm->argv[i]) + 1; in setup_initial_stack()
105 for (i = 0; i < bprm->envc; ++i) { in setup_initial_stack()
106 stringspace += strlen(bprm->envp[i]) + 1; in setup_initial_stack()
114 p = argvp = destp - (bprm->argc + bprm->envc + 2) * sizeof(abi_ulong); in setup_initial_stack()
125 ps_strs.ps_nargvstr = tswap32(bprm->argc); in setup_initial_stack()
[all …]
/openbmc/linux/security/apparmor/
H A Ddomain.c305 static int aa_xattrs_match(const struct linux_binprm *bprm, in aa_xattrs_match() argument
314 if (!bprm || !attach->xattr_count) in aa_xattrs_match()
320 d = bprm->file->f_path.dentry; in aa_xattrs_match()
384 static struct aa_label *find_attach(const struct linux_binprm *bprm, in find_attach() argument
432 if (bprm && attach->xattr_count) { in find_attach()
438 ret = aa_xattrs_match(bprm, profile, in find_attach()
561 const struct linux_binprm *bprm, in x_to_label() argument
591 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label()
595 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label()
631 const struct linux_binprm *bprm, in profile_transition() argument
[all …]
/openbmc/linux/include/linux/
H A Dbinfmts.h111 extern int begin_new_exec(struct linux_binprm * bprm);
112 extern void setup_new_exec(struct linux_binprm * bprm);
113 extern void finalize_exec(struct linux_binprm *bprm);
123 extern int setup_arg_pages(struct linux_binprm * bprm,
126 extern int transfer_args_to_stack(struct linux_binprm *bprm,
128 extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm);
129 int copy_string_kernel(const char *arg, struct linux_binprm *bprm);
H A Daudit.h405 extern void __audit_bprm(struct linux_binprm *bprm);
413 extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
441 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument
444 __audit_bprm(bprm); in audit_bprm()
493 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
498 return __audit_log_bprm_fcaps(bprm, new, old); in audit_log_bprm_fcaps()
635 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument
664 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
/openbmc/qemu/bsd-user/netbsd/
H A Dtarget_os_stack.h25 static inline int setup_initial_stack(struct bsd_binprm *bprm, abi_ulong *p, in setup_initial_stack() argument
41 if (bprm->page[i]) { in setup_initial_stack()
43 if (!memcpy_to_target(stack_base, bprm->page[i], in setup_initial_stack()
48 g_free(bprm->page[i]); in setup_initial_stack()
/openbmc/qemu/bsd-user/openbsd/
H A Dtarget_os_stack.h25 static inline int setup_initial_stack(struct bsd_binprm *bprm, abi_ulong *p, in setup_initial_stack() argument
41 if (bprm->page[i]) { in setup_initial_stack()
43 if (!memcpy_to_target(stack_base, bprm->page[i], in setup_initial_stack()
48 g_free(bprm->page[i]); in setup_initial_stack()
/openbmc/linux/security/tomoyo/
H A Daudit.c22 static char *tomoyo_print_bprm(struct linux_binprm *bprm, in tomoyo_print_bprm() argument
30 unsigned long pos = bprm->p; in tomoyo_print_bprm()
32 int argv_count = bprm->argc; in tomoyo_print_bprm()
33 int envp_count = bprm->envc; in tomoyo_print_bprm()
46 if (!tomoyo_dump_page(bprm, pos, dump)) in tomoyo_print_bprm()
261 struct file *file = r->ee->bprm->file; in tomoyo_init_log()
264 bprm_info = tomoyo_print_bprm(r->ee->bprm, &r->ee->dump); in tomoyo_init_log()
281 struct linux_binprm *bprm = r->ee->bprm; in tomoyo_init_log() local
285 realpath, bprm->argc, bprm->envc, bprm_info); in tomoyo_init_log()
H A Ddomain.c616 struct linux_binprm *bprm = ee->bprm; in tomoyo_environ() local
621 unsigned long pos = bprm->p; in tomoyo_environ()
623 int argv_count = bprm->argc; in tomoyo_environ()
624 int envp_count = bprm->envc; in tomoyo_environ()
637 if (!tomoyo_dump_page(bprm, pos, &env_page)) in tomoyo_environ()
701 int tomoyo_find_next_domain(struct linux_binprm *bprm) in tomoyo_find_next_domain() argument
705 const char *original_name = bprm->filename; in tomoyo_find_next_domain()
722 ee->bprm = bprm; in tomoyo_find_next_domain()
724 ee->obj.path1 = bprm->file->f_path; in tomoyo_find_next_domain()
729 exename.name = tomoyo_realpath_from_path(&bprm->file->f_path); in tomoyo_find_next_domain()
[all …]
H A Dcondition.c109 struct linux_binprm *bprm = ee->bprm; in tomoyo_scan_bprm() local
113 unsigned long pos = bprm->p; in tomoyo_scan_bprm()
115 int argv_count = bprm->argc; in tomoyo_scan_bprm()
116 int envp_count = bprm->envc; in tomoyo_scan_bprm()
130 if (!tomoyo_dump_page(bprm, pos, dump)) { in tomoyo_scan_bprm()
160 if (!tomoyo_argv(bprm->argc - argv_count, in tomoyo_scan_bprm()
780 struct linux_binprm *bprm = NULL; in tomoyo_condition() local
789 bprm = r->ee->bprm; in tomoyo_condition()
790 if (!bprm && (argc || envc)) in tomoyo_condition()
826 file = ee ? ee->bprm->file : NULL; in tomoyo_condition()
[all …]
H A Dtomoyo.c55 static void tomoyo_bprm_committed_creds(struct linux_binprm *bprm) in tomoyo_bprm_committed_creds() argument
72 static int tomoyo_bprm_creds_for_exec(struct linux_binprm *bprm) in tomoyo_bprm_creds_for_exec() argument
79 tomoyo_load_policy(bprm->filename); in tomoyo_bprm_creds_for_exec()
91 static int tomoyo_bprm_check_security(struct linux_binprm *bprm) in tomoyo_bprm_check_security() argument
101 const int err = tomoyo_find_next_domain(bprm); in tomoyo_bprm_check_security()
110 &bprm->file->f_path, O_RDONLY); in tomoyo_bprm_check_security()
/openbmc/linux/tools/testing/selftests/bpf/progs/
H A Dima.c67 void BPF_PROG(bprm_committed_creds, struct linux_binprm *bprm) in BPF_PROG() argument
69 ima_test_common(bprm->file); in BPF_PROG()
73 int BPF_PROG(bprm_creds_for_exec, struct linux_binprm *bprm) in BPF_PROG() argument
78 ima_test_common(bprm->file); in BPF_PROG()
H A Dbprm_opts.c22 int BPF_PROG(secure_exec, struct linux_binprm *bprm) in BPF_PROG() argument
31 bpf_bprm_opts_set(bprm, BPF_F_BPRM_SECUREEXEC); in BPF_PROG()
/openbmc/linux/security/
H A Dcommoncap.c587 struct linux_binprm *bprm, in bprm_caps_from_vfs_caps() argument
591 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
723 static int get_file_caps(struct linux_binprm *bprm, struct file *file, in get_file_caps() argument
729 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
750 bprm->filename); in get_file_caps()
756 rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap); in get_file_caps()
760 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
788 static void handle_privileged_root(struct linux_binprm *bprm, bool has_fcap, in handle_privileged_root() argument
792 struct cred *new = bprm->cred; in handle_privileged_root()
802 warn_setuid_and_fcaps_mixed(bprm->filename); in handle_privileged_root()
[all …]
/openbmc/linux/arch/riscv/kernel/
H A Dvdso.c216 struct linux_binprm *bprm, in __setup_additional_pages() argument
259 int compat_arch_setup_additional_pages(struct linux_binprm *bprm, in compat_arch_setup_additional_pages() argument
268 ret = __setup_additional_pages(mm, bprm, uses_interp, in compat_arch_setup_additional_pages()
276 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument
284 ret = __setup_additional_pages(mm, bprm, uses_interp, &vdso_info); in arch_setup_additional_pages()

1234