/fs/ |
D | exec.c | 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 204 ret = expand_downwards(bprm->vma, pos); in get_arg_page() 217 ret = get_user_pages_remote(current, bprm->mm, pos, 1, gup_flags, in get_arg_page() 223 acct_arg_size(bprm, vma_pages(bprm->vma)); in get_arg_page() 233 static void free_arg_pages(struct linux_binprm *bprm) in free_arg_pages() argument 237 static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, in flush_arg_page() argument 240 flush_cache_page(bprm->vma, pos, page_to_pfn(page)); in flush_arg_page() [all …]
|
D | binfmt_script.c | 34 static int load_script(struct linux_binprm *bprm) in load_script() argument 42 if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) in load_script() 51 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_script() 55 allow_write_access(bprm->file); in load_script() 56 fput(bprm->file); in load_script() 57 bprm->file = NULL; in load_script() 73 buf_end = bprm->buf + sizeof(bprm->buf) - 1; in load_script() 74 cp = strnchr(bprm->buf, sizeof(bprm->buf), '\n'); in load_script() 76 cp = next_non_spacetab(bprm->buf + 2, buf_end); in load_script() 89 while (cp > bprm->buf) { in load_script() [all …]
|
D | binfmt_em86.c | 26 static int load_em86(struct linux_binprm *bprm) in load_em86() argument 35 elf_ex = *((struct elfhdr *)bprm->buf); in load_em86() 43 !bprm->file->f_op->mmap) { in load_em86() 48 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_em86() 51 allow_write_access(bprm->file); in load_em86() 52 fput(bprm->file); in load_em86() 53 bprm->file = NULL; in load_em86() 70 remove_arg_zero(bprm); in load_em86() 71 retval = copy_strings_kernel(1, &bprm->filename, bprm); in load_em86() 73 bprm->argc++; in load_em86() [all …]
|
D | binfmt_flat.c | 123 static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start) in create_flat_tables() argument 132 sp -= bprm->envc + 1; in create_flat_tables() 133 sp -= bprm->argc + 1; in create_flat_tables() 141 __put_user(bprm->argc, sp++); in create_flat_tables() 145 envp = (unsigned long)(sp + 2 + bprm->argc + 1); in create_flat_tables() 151 for (i = bprm->argc; i > 0; i--) { in create_flat_tables() 162 for (i = bprm->envc; i > 0; i--) { in create_flat_tables() 192 static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst, in decompress_exec() argument 213 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() 283 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() [all …]
|
D | binfmt_aout.c | 59 static unsigned long __user *create_aout_tables(char __user *p, struct linux_binprm * bprm) in create_aout_tables() argument 64 int argc = bprm->argc; in create_aout_tables() 65 int envc = bprm->envc; in create_aout_tables() 72 if (bprm->loader) { in create_aout_tables() 75 put_user(bprm->loader, --sp); in create_aout_tables() 78 put_user(bprm->exec, --sp); in create_aout_tables() 117 static int load_aout_binary(struct linux_binprm * bprm) in load_aout_binary() argument 126 ex = *((struct exec *) bprm->buf); /* exec-header */ in load_aout_binary() 130 i_size_read(file_inode(bprm->file)) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { in load_aout_binary() 138 if (!bprm->file->f_op->mmap) in load_aout_binary() [all …]
|
D | binfmt_misc.c | 90 static Node *check_file(struct linux_binprm *bprm) in check_file() argument 92 char *p = strrchr(bprm->interp, '.'); in check_file() 113 s = bprm->buf + e->offset; in check_file() 132 static int load_misc_binary(struct linux_binprm *bprm) in load_misc_binary() argument 145 fmt = check_file(bprm); in load_misc_binary() 154 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_misc_binary() 158 retval = remove_arg_zero(bprm); in load_misc_binary() 174 fd_install(fd_binary, bprm->file); in load_misc_binary() 178 would_dump(bprm, bprm->file); in load_misc_binary() 180 allow_write_access(bprm->file); in load_misc_binary() [all …]
|
D | binfmt_elf_fdpic.c | 182 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 = flush_old_exec(bprm); in load_elf_fdpic_binary() 354 setup_new_exec(bprm); in load_elf_fdpic_binary() [all …]
|
D | binfmt_elf.c | 60 static int load_elf_binary(struct linux_binprm *bprm); 164 create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, in create_elf_tables() argument 167 unsigned long p = bprm->p; in create_elf_tables() 168 int argc = bprm->argc; in create_elf_tables() 169 int envc = bprm->envc; in create_elf_tables() 259 NEW_AUX_ENT(AT_SECURE, bprm->secureexec); in create_elf_tables() 264 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_tables() 273 if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { in create_elf_tables() 274 NEW_AUX_ENT(AT_EXECFD, bprm->interp_data); in create_elf_tables() 287 bprm->p = STACK_ROUND(sp, items); in create_elf_tables() [all …]
|