Home
last modified time | relevance | path

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

1234

/openbmc/linux/fs/
H A Dexec.c512 bprm->argmin = bprm->p - limit; in bprm_stack_limits()
552 if (bprm->p < bprm->argmin) in copy_strings()
1287 would_dump(bprm, bprm->file); in begin_new_exec()
1289 would_dump(bprm, bprm->executable); in begin_new_exec()
1508 if (bprm->interp != bprm->filename) in free_bprm()
1532 bprm->filename = bprm->fdpath; in alloc_bprm()
1534 bprm->interp = bprm->filename; in alloc_bprm()
1550 if (bprm->interp != bprm->filename) in bprm_change_interp()
1796 bprm->file = bprm->interpreter; in exec_binprm()
1949 bprm->exec = bprm->p; in do_execveat_common()
[all …]
H A Dbinfmt_script.c41 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()
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()
116 retval = copy_string_kernel(i_arg, bprm); in load_script()
119 bprm->argc++; in load_script()
121 retval = copy_string_kernel(i_name, bprm); in load_script()
124 bprm->argc++; in load_script()
[all …]
H A Dbinfmt_flat.c117 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()
137 for (i = bprm->argc; i > 0; i--) { in create_flat_tables()
150 for (i = bprm->envc; i > 0; i--) { in create_flat_tables()
509 ret = begin_new_exec(bprm); in load_flat_file()
515 setup_new_exec(bprm); in load_flat_file()
677 result = read_code(bprm->file, datapos, in load_flat_file()
716 "Load", bprm->filename, in load_flat_file()
904 res = create_flat_tables(bprm, bprm->p); in load_flat_binary()
[all …]
H A Dbinfmt_misc.c96 char *p = strrchr(bprm->interp, '.'); in search_binfmt_handler()
116 s = bprm->buf + e->offset; in search_binfmt_handler()
148 e = search_binfmt_handler(bprm); in get_binfmt_handler()
185 fmt = get_binfmt_handler(bprm); in load_misc_binary()
197 retval = remove_arg_zero(bprm); in load_misc_binary()
203 bprm->have_execfd = 1; in load_misc_binary()
206 retval = copy_string_kernel(bprm->interp, bprm); in load_misc_binary()
209 bprm->argc++; in load_misc_binary()
215 bprm->argc++; in load_misc_binary()
233 bprm->interpreter = interp_file; in load_misc_binary()
[all …]
H A Dbinfmt_elf_fdpic.c274 would_dump(bprm, interpreter); 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()
461 finalize_exec(bprm); in load_elf_fdpic_binary()
517 sp = arch_align_stack(bprm->p); in create_elf_fdpic_tables()
592 if (bprm->have_execfd) in create_elf_fdpic_tables()
634 if (bprm->have_execfd) { in create_elf_fdpic_tables()
637 NEW_AUX_ENT(AT_EXECFD, bprm->execfd); in create_elf_fdpic_tables()
661 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_fdpic_tables()
689 current->mm->arg_start = bprm->p; in create_elf_fdpic_tables()
[all …]
H A Dbinfmt_elf.c180 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()
289 if (bprm->have_execfd) { in create_elf_tables()
857 if (!bprm->file->f_op->mmap) in load_elf_binary()
908 would_dump(bprm, interpreter); in load_elf_binary()
941 bprm->file, false, in load_elf_binary()
1001 retval = begin_new_exec(bprm); in load_elf_binary()
1015 setup_new_exec(bprm); in load_elf_binary()
1302 mm->start_stack = bprm->p; in load_elf_binary()
[all …]
/openbmc/qemu/bsd-user/
H A Dbsdload.c66 bprm->e_uid = geteuid(); in prepare_binprm()
67 bprm->e_gid = getegid(); in prepare_binprm()
84 memset(bprm->buf, 0, sizeof(bprm->buf)); in prepare_binprm()
87 retval = read(bprm->fd, bprm->buf, 128); in prepare_binprm()
156 bprm->page[i] = NULL; in loader_exec()
181 bprm->fullpath = path; in loader_exec()
182 bprm->fd = retval; in loader_exec()
184 bprm->argc = count(argv); in loader_exec()
185 bprm->argv = argv; in loader_exec()
186 bprm->envc = count(envp); in loader_exec()
[all …]
H A Delfload.c626 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()
722 close(bprm->fd); in load_elf_binary()
731 if (!bprm->p) { in load_elf_binary()
734 close(bprm->fd); in load_elf_binary()
763 setup_arg_pages(bprm, info, &bprm->p, &bprm->stringp); in load_elf_binary()
808 close(bprm->fd); in load_elf_binary()
810 bprm->p = target_create_elf_tables(bprm->p, bprm->argc, bprm->envc, in load_elf_binary()
[all …]
H A Dmain.c261 struct bsd_binprm bprm; in main() local
433 memset(&bprm, 0, sizeof(bprm)); in main()
564 &bprm) != 0) { in main()
603 ts->bprm = &bprm; in main()
/openbmc/qemu/linux-user/
H A Dlinuxload.c54 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()
72 retval = read(bprm->src.fd, bprm->buf, BPRM_BUF_SIZE); in prepare_binprm()
82 bprm->src.cache = bprm->buf; in prepare_binprm()
147 bprm->src.fd = fdexec; in loader_exec()
149 bprm->argc = count(argv); in loader_exec()
150 bprm->argv = argv; in loader_exec()
151 bprm->envc = count(envp); in loader_exec()
152 bprm->envp = envp; in loader_exec()
[all …]
H A Dflatload.c192 static int load_flat_file(struct linux_binprm * bprm, in load_flat_file() argument
262 probe_guest_base(bprm->filename, 0, in load_flat_file()
343 id ? "Lib" : "Load", bprm->filename, in load_flat_file()
478 for (i = 0; i < bprm->argc; ++i) { in load_flt_binary()
480 stack_len += strlen(bprm->argv[i]); in load_flt_binary()
482 for (i = 0; i < bprm->envc; ++i) { in load_flt_binary()
484 stack_len += strlen(bprm->envp[i]); in load_flt_binary()
519 p = copy_strings(p, bprm->envc, bprm->envp); in load_flt_binary()
520 p = copy_strings(p, bprm->argc, bprm->argv); in load_flt_binary()
525 stack_len = bprm->envc + bprm->argc + 2; in load_flt_binary()
[all …]
/openbmc/qemu/bsd-user/freebsd/
H A Dtarget_os_stack.h70 if (bprm->fullpath) { 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()
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()
126 for (i = 0; i < bprm->argc; ++i) { in setup_initial_stack()
127 size_t len = strlen(bprm->argv[i]) + 1; in setup_initial_stack()
150 ps_strs.ps_nenvstr = tswap32(bprm->envc); in setup_initial_stack()
151 for (i = 0; i < bprm->envc; ++i) { in setup_initial_stack()
[all …]
/openbmc/linux/include/linux/
H A Dbinfmts.h109 extern int begin_new_exec(struct linux_binprm * bprm);
110 extern void setup_new_exec(struct linux_binprm * bprm);
111 extern void finalize_exec(struct linux_binprm *bprm);
121 extern int setup_arg_pages(struct linux_binprm * bprm,
124 extern int transfer_args_to_stack(struct linux_binprm *bprm,
126 extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm);
127 int copy_string_kernel(const char *arg, struct linux_binprm *bprm);
/openbmc/linux/security/apparmor/
H A Ddomain.c320 d = bprm->file->f_path.dentry; in aa_xattrs_match()
645 AA_BUG(!bprm); in profile_transition()
657 name = bprm->filename; in profile_transition()
746 AA_BUG(!bprm); in profile_onexec()
767 xname = bprm->filename; in profile_onexec()
820 AA_BUG(!bprm); in handle_onexec()
882 file_inode(bprm->file)); in apparmor_bprm_creds_for_exec()
885 file_inode(bprm->file)->i_mode in apparmor_bprm_creds_for_exec()
890 AA_BUG(!cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec()
963 "label=", bprm->filename); in apparmor_bprm_creds_for_exec()
[all …]
/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/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/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()
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()
919 mmap_read_lock(bprm->mm); in tomoyo_dump_page()
922 mmap_read_unlock(bprm->mm); in tomoyo_dump_page()
[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()
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()
928 if (!bprm) in tomoyo_condition()
930 value = bprm->argc; in tomoyo_condition()
933 if (!bprm) 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/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()
729 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
750 bprm->filename); in get_file_caps()
760 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
792 struct cred *new = bprm->cred; in handle_privileged_root()
889 struct cred *new = bprm->cred; in cap_bprm_creds_from_file()
907 bprm->per_clear |= PER_CLEAR_ON_SETID; in cap_bprm_creds_from_file()
917 ((bprm->unsafe & ~LSM_UNSAFE_PTRACE) || in cap_bprm_creds_from_file()
955 ret = audit_log_bprm_fcaps(bprm, new, old); in cap_bprm_creds_from_file()
[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()
/openbmc/linux/arch/arm64/kernel/
H A Dvdso.c190 struct linux_binprm *bprm, in __setup_additional_pages() argument
388 int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in aarch32_setup_additional_pages() argument
401 ret = __setup_additional_pages(VDSO_ABI_AA32, mm, bprm, in aarch32_setup_additional_pages()
439 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument
447 ret = __setup_additional_pages(VDSO_ABI_AA64, mm, bprm, uses_interp); in arch_setup_additional_pages()

1234