/fs/ |
D | binfmt_script.c | 18 static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) in load_script() argument 25 if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || in load_script() 26 (bprm->recursion_depth > BINPRM_MAX_RECURSION)) in load_script() 33 bprm->recursion_depth++; in load_script() 34 allow_write_access(bprm->file); in load_script() 35 fput(bprm->file); in load_script() 36 bprm->file = NULL; in load_script() 38 bprm->buf[BINPRM_BUF_SIZE - 1] = '\0'; in load_script() 39 if ((cp = strchr(bprm->buf, '\n')) == NULL) in load_script() 40 cp = bprm->buf+BINPRM_BUF_SIZE-1; in load_script() [all …]
|
D | exec.c | 171 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, in get_arg_page() argument 179 ret = expand_stack_downwards(bprm->vma, pos); in get_arg_page() 184 ret = get_user_pages(current, bprm->mm, pos, in get_arg_page() 190 unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; in get_arg_page() 222 static void free_arg_page(struct linux_binprm *bprm, int i) in free_arg_page() argument 226 static void free_arg_pages(struct linux_binprm *bprm) in free_arg_pages() argument 230 static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, in flush_arg_page() argument 233 flush_cache_page(bprm->vma, pos, page_to_pfn(page)); in flush_arg_page() 236 static int __bprm_mm_init(struct linux_binprm *bprm) in __bprm_mm_init() argument 240 struct mm_struct *mm = bprm->mm; in __bprm_mm_init() [all …]
|
D | binfmt_em86.c | 26 static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs) in load_em86() argument 34 elf_ex = *((struct elfhdr *)bprm->buf); in load_em86() 42 (!bprm->file->f_op || !bprm->file->f_op->mmap)) { in load_em86() 46 bprm->recursion_depth++; /* Well, the bang-shell is implicit... */ in load_em86() 47 allow_write_access(bprm->file); in load_em86() 48 fput(bprm->file); in load_em86() 49 bprm->file = NULL; in load_em86() 66 remove_arg_zero(bprm); in load_em86() 67 retval = copy_strings_kernel(1, &bprm->filename, bprm); in load_em86() 69 bprm->argc++; in load_em86() [all …]
|
D | binfmt_flat.c | 108 struct linux_binprm * bprm) in create_flat_tables() argument 113 int argc = bprm->argc; in create_flat_tables() 114 int envc = bprm->envc; in create_flat_tables() 169 struct linux_binprm *bprm, in decompress_exec() argument 197 ret = bprm->file->f_op->read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() 267 ret = bprm->file->f_op->read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() 413 static int load_flat_file(struct linux_binprm * bprm, in load_flat_file() argument 429 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ in load_flat_file() 430 inode = bprm->file->f_path.dentry->d_inode; in load_flat_file() 457 printk("BINFMT_FLAT: Loading file: %s\n", bprm->filename); in load_flat_file() [all …]
|
D | binfmt_som.c | 38 static int load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs); 68 static void create_som_tables(struct linux_binprm *bprm) in create_som_tables() argument 71 int argc = bprm->argc; in create_som_tables() 72 int envc = bprm->envc; in create_som_tables() 77 sp = (unsigned long *)((bprm->p + 3) & ~3); in create_som_tables() 89 bprm->p = (unsigned long) sp; in create_som_tables() 189 load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs) in load_som_binary() argument 199 som_ex = (struct som_hdr *) bprm->buf; in load_som_binary() 215 retval = kernel_read(bprm->file, som_ex->aux_header_location, in load_som_binary() 226 get_file(bprm->file); in load_som_binary() [all …]
|
D | binfmt_misc.c | 68 static Node *check_file(struct linux_binprm *bprm) in check_file() argument 70 char *p = strrchr(bprm->interp, '.'); in check_file() 87 s = bprm->buf + e->offset; in check_file() 106 static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) in load_misc_binary() argument 120 if (bprm->recursion_depth > BINPRM_MAX_RECURSION) in load_misc_binary() 125 fmt = check_file(bprm); in load_misc_binary() 133 retval = remove_arg_zero(bprm); in load_misc_binary() 148 fd_install(fd_binary, bprm->file); in load_misc_binary() 152 if (file_permission(bprm->file, MAY_READ)) in load_misc_binary() 153 bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP; in load_misc_binary() [all …]
|
D | binfmt_aout.c | 162 static unsigned long __user *create_aout_tables(char __user *p, struct linux_binprm * bprm) in create_aout_tables() argument 167 int argc = bprm->argc; in create_aout_tables() 168 int envc = bprm->envc; in create_aout_tables() 175 if (bprm->loader) { in create_aout_tables() 178 put_user(bprm->loader, --sp); in create_aout_tables() 181 put_user(bprm->exec, --sp); in create_aout_tables() 220 static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) in load_aout_binary() argument 228 ex = *((struct exec *) bprm->buf); /* exec-header */ in load_aout_binary() 232 …i_size_read(bprm->file->f_path.dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { in load_aout_binary() 240 if (!bprm->file->f_op || !bprm->file->f_op->mmap) in load_aout_binary() [all …]
|
D | binfmt_elf_fdpic.c | 165 static int load_elf_fdpic_binary(struct linux_binprm *bprm, in load_elf_fdpic_binary() argument 184 exec_params.hdr = *(struct elfhdr *) bprm->buf; in load_elf_fdpic_binary() 189 if (!is_elf_fdpic(&exec_params.hdr, bprm->file)) in load_elf_fdpic_binary() 193 retval = elf_fdpic_fetch_phdrs(&exec_params, bprm->file); in load_elf_fdpic_binary() 215 retval = kernel_read(bprm->file, in load_elf_fdpic_binary() 245 bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP; in load_elf_fdpic_binary() 247 retval = kernel_read(interpreter, 0, bprm->buf, in load_elf_fdpic_binary() 255 interp_params.hdr = *((struct elfhdr *) bprm->buf); in load_elf_fdpic_binary() 308 retval = flush_old_exec(bprm); in load_elf_fdpic_binary() 334 retval = setup_arg_pages(bprm, current->mm->start_stack, in load_elf_fdpic_binary() [all …]
|
D | binfmt_elf.c | 45 static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs); 144 create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, in create_elf_tables() argument 147 unsigned long p = bprm->p; in create_elf_tables() 148 int argc = bprm->argc; in create_elf_tables() 149 int envc = bprm->envc; in create_elf_tables() 241 NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm)); in create_elf_tables() 243 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_tables() 252 if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { in create_elf_tables() 253 NEW_AUX_ENT(AT_EXECFD, bprm->interp_data); in create_elf_tables() 266 bprm->p = STACK_ROUND(sp, items); in create_elf_tables() [all …]
|
D | compat.c | 1293 struct linux_binprm *bprm) in compat_copy_strings() argument 1317 pos = bprm->p; in compat_copy_strings() 1319 bprm->p -= len; in compat_copy_strings() 1341 ret = expand_stack_downwards(bprm->vma, pos); in compat_copy_strings() 1348 ret = get_user_pages(current, bprm->mm, pos, in compat_copy_strings() 1364 flush_cache_page(bprm->vma, kpos, in compat_copy_strings() 1393 struct linux_binprm *bprm; in compat_do_execve() local 1398 bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); in compat_do_execve() 1399 if (!bprm) in compat_do_execve() 1407 bprm->cred = prepare_exec_creds(); in compat_do_execve() [all …]
|