bprm 9 arch/alpha/kernel/binfmt_loader.c static int load_binary(struct linux_binprm *bprm) bprm 11 arch/alpha/kernel/binfmt_loader.c struct exec *eh = (struct exec *)bprm->buf; bprm 19 arch/alpha/kernel/binfmt_loader.c if (bprm->loader) bprm 22 arch/alpha/kernel/binfmt_loader.c allow_write_access(bprm->file); bprm 23 arch/alpha/kernel/binfmt_loader.c fput(bprm->file); bprm 24 arch/alpha/kernel/binfmt_loader.c bprm->file = NULL; bprm 26 arch/alpha/kernel/binfmt_loader.c loader = bprm->vma->vm_end - sizeof(void *); bprm 34 arch/alpha/kernel/binfmt_loader.c bprm->taso = eh->ah.entry < 0x100000000UL; bprm 36 arch/alpha/kernel/binfmt_loader.c bprm->file = file; bprm 37 arch/alpha/kernel/binfmt_loader.c bprm->loader = loader; bprm 38 arch/alpha/kernel/binfmt_loader.c retval = prepare_binprm(bprm); bprm 41 arch/alpha/kernel/binfmt_loader.c return search_binary_handler(bprm); bprm 415 arch/arm/kernel/process.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 161 arch/arm64/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 220 arch/arm64/include/asm/elf.h extern int aarch32_setup_additional_pages(struct linux_binprm *bprm, bprm 141 arch/arm64/kernel/vdso.c struct linux_binprm *bprm, bprm 344 arch/arm64/kernel/vdso.c int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 359 arch/arm64/kernel/vdso.c bprm, bprm 404 arch/arm64/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 415 arch/arm64/kernel/vdso.c bprm, bprm 90 arch/csky/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 47 arch/csky/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 213 arch/hexagon/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 49 arch/hexagon/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 481 arch/mips/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 87 arch/mips/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 114 arch/nds32/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 33 arch/nios2/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 110 arch/nios2/mm/init.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 254 arch/parisc/include/asm/processor.h elf_caddr_t *argv = (elf_caddr_t *)bprm->exec + 1; \ bprm 119 arch/powerpc/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 126 arch/powerpc/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 68 arch/riscv/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 55 arch/riscv/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 201 arch/s390/kernel/vdso.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 194 arch/sh/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 58 arch/sh/kernel/vsyscall/vsyscall.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 231 arch/sparc/include/asm/elf_64.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 429 arch/sparc/vdso/vma.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 87 arch/unicore32/include/asm/elf.h #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping() bprm 289 arch/x86/entry/vdso/vma.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 298 arch/x86/entry/vdso/vma.c int compat_arch_setup_additional_pages(struct linux_binprm *bprm, bprm 316 arch/x86/entry/vdso/vma.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 64 arch/x86/ia32/ia32_aout.c static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm) bprm 67 arch/x86/ia32/ia32_aout.c int argc = bprm->argc, envc = bprm->envc; bprm 105 arch/x86/ia32/ia32_aout.c static int load_aout_binary(struct linux_binprm *bprm) bprm 112 arch/x86/ia32/ia32_aout.c ex = *((struct exec *) bprm->buf); /* exec-header */ bprm 116 arch/x86/ia32/ia32_aout.c i_size_read(file_inode(bprm->file)) < bprm 134 arch/x86/ia32/ia32_aout.c retval = flush_old_exec(bprm); bprm 142 arch/x86/ia32/ia32_aout.c setup_new_exec(bprm); bprm 155 arch/x86/ia32/ia32_aout.c retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT); bprm 159 arch/x86/ia32/ia32_aout.c install_exec_creds(bprm); bprm 172 arch/x86/ia32/ia32_aout.c error = read_code(bprm->file, text_addr, 32, bprm 191 arch/x86/ia32/ia32_aout.c bprm->file); bprm 196 arch/x86/ia32/ia32_aout.c if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) { bprm 201 arch/x86/ia32/ia32_aout.c read_code(bprm->file, N_TXTADDR(ex), fd_offset, bprm 206 arch/x86/ia32/ia32_aout.c error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, bprm 215 arch/x86/ia32/ia32_aout.c error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data, bprm 232 arch/x86/ia32/ia32_aout.c (unsigned long)create_aout_tables((char __user *)bprm->p, bprm); bprm 364 arch/x86/include/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 366 arch/x86/include/asm/elf.h extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm, bprm 64 arch/x86/include/asm/ia32.h extern int ia32_setup_arg_pages(struct linux_binprm *bprm, bprm 186 arch/x86/um/asm/elf.h extern int arch_setup_additional_pages(struct linux_binprm *bprm, bprm 53 arch/x86/um/vdso/vma.c int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) bprm 59 fs/binfmt_aout.c static unsigned long __user *create_aout_tables(char __user *p, struct linux_binprm * bprm) bprm 64 fs/binfmt_aout.c int argc = bprm->argc; bprm 65 fs/binfmt_aout.c int envc = bprm->envc; bprm 72 fs/binfmt_aout.c if (bprm->loader) { bprm 75 fs/binfmt_aout.c put_user(bprm->loader, --sp); bprm 78 fs/binfmt_aout.c put_user(bprm->exec, --sp); bprm 117 fs/binfmt_aout.c static int load_aout_binary(struct linux_binprm * bprm) bprm 126 fs/binfmt_aout.c ex = *((struct exec *) bprm->buf); /* exec-header */ bprm 130 fs/binfmt_aout.c i_size_read(file_inode(bprm->file)) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { bprm 138 fs/binfmt_aout.c if (!bprm->file->f_op->mmap) bprm 154 fs/binfmt_aout.c retval = flush_old_exec(bprm); bprm 160 fs/binfmt_aout.c SET_AOUT_PERSONALITY(bprm, ex); bprm 164 fs/binfmt_aout.c setup_new_exec(bprm); bprm 173 fs/binfmt_aout.c retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT); bprm 177 fs/binfmt_aout.c install_exec_creds(bprm); bprm 196 fs/binfmt_aout.c error = read_code(bprm->file, text_addr, pos, bprm 211 fs/binfmt_aout.c bprm->file); bprm 214 fs/binfmt_aout.c if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) { bprm 219 fs/binfmt_aout.c read_code(bprm->file, N_TXTADDR(ex), fd_offset, bprm 224 fs/binfmt_aout.c error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, bprm 232 fs/binfmt_aout.c error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data, bprm 247 fs/binfmt_aout.c (unsigned long) create_aout_tables((char __user *) bprm->p, bprm); bprm 251 fs/binfmt_aout.c finalize_exec(bprm); bprm 60 fs/binfmt_elf.c static int load_elf_binary(struct linux_binprm *bprm); bprm 164 fs/binfmt_elf.c create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, bprm 167 fs/binfmt_elf.c unsigned long p = bprm->p; bprm 168 fs/binfmt_elf.c int argc = bprm->argc; bprm 169 fs/binfmt_elf.c int envc = bprm->envc; bprm 259 fs/binfmt_elf.c NEW_AUX_ENT(AT_SECURE, bprm->secureexec); bprm 264 fs/binfmt_elf.c NEW_AUX_ENT(AT_EXECFN, bprm->exec); bprm 273 fs/binfmt_elf.c if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { bprm 274 fs/binfmt_elf.c NEW_AUX_ENT(AT_EXECFD, bprm->interp_data); bprm 287 fs/binfmt_elf.c bprm->p = STACK_ROUND(sp, items); bprm 291 fs/binfmt_elf.c sp = (elf_addr_t __user *)bprm->p - items - ei_index; bprm 292 fs/binfmt_elf.c bprm->exec = (unsigned long)sp; /* XXX: PARISC HACK */ bprm 294 fs/binfmt_elf.c sp = (elf_addr_t __user *)bprm->p; bprm 302 fs/binfmt_elf.c vma = find_extend_vma(current->mm, bprm->p); bprm 673 fs/binfmt_elf.c static int load_elf_binary(struct linux_binprm *bprm) bprm 702 fs/binfmt_elf.c loc->elf_ex = *((struct elfhdr *)bprm->buf); bprm 715 fs/binfmt_elf.c if (!bprm->file->f_op->mmap) bprm 718 fs/binfmt_elf.c elf_phdata = load_elf_phdrs(&loc->elf_ex, bprm->file); bprm 744 fs/binfmt_elf.c retval = kernel_read(bprm->file, elf_interpreter, bprm 766 fs/binfmt_elf.c would_dump(bprm, interpreter); bprm 797 fs/binfmt_elf.c bprm->file, false, bprm 847 fs/binfmt_elf.c retval = flush_old_exec(bprm); bprm 860 fs/binfmt_elf.c setup_new_exec(bprm); bprm 861 fs/binfmt_elf.c install_exec_creds(bprm); bprm 865 fs/binfmt_elf.c retval = setup_arg_pages(bprm, randomize_stack_top(STACK_TOP), bprm 983 fs/binfmt_elf.c error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, bprm 1094 fs/binfmt_elf.c retval = arch_setup_additional_pages(bprm, !!interpreter); bprm 1099 fs/binfmt_elf.c retval = create_elf_tables(bprm, &loc->elf_ex, bprm 1107 fs/binfmt_elf.c current->mm->start_stack = bprm->p; bprm 1153 fs/binfmt_elf.c finalize_exec(bprm); bprm 1154 fs/binfmt_elf.c start_thread(regs, elf_entry, bprm->p); bprm 182 fs/binfmt_elf_fdpic.c static int load_elf_fdpic_binary(struct linux_binprm *bprm) bprm 205 fs/binfmt_elf_fdpic.c exec_params.hdr = *(struct elfhdr *) bprm->buf; bprm 210 fs/binfmt_elf_fdpic.c if (!is_elf(&exec_params.hdr, bprm->file)) bprm 224 fs/binfmt_elf_fdpic.c retval = elf_fdpic_fetch_phdrs(&exec_params, bprm->file); bprm 247 fs/binfmt_elf_fdpic.c retval = kernel_read(bprm->file, interpreter_name, bprm 274 fs/binfmt_elf_fdpic.c would_dump(bprm, interpreter); bprm 277 fs/binfmt_elf_fdpic.c retval = kernel_read(interpreter, bprm->buf, bprm 285 fs/binfmt_elf_fdpic.c interp_params.hdr = *((struct elfhdr *) bprm->buf); bprm 341 fs/binfmt_elf_fdpic.c retval = flush_old_exec(bprm); bprm 355 fs/binfmt_elf_fdpic.c setup_new_exec(bprm); bprm 373 fs/binfmt_elf_fdpic.c retval = setup_arg_pages(bprm, current->mm->start_stack, bprm 378 fs/binfmt_elf_fdpic.c retval = arch_setup_additional_pages(bprm, !!interpreter_name); bprm 385 fs/binfmt_elf_fdpic.c retval = elf_fdpic_map_file(&exec_params, bprm->file, current->mm, bprm 437 fs/binfmt_elf_fdpic.c install_exec_creds(bprm); bprm 438 fs/binfmt_elf_fdpic.c if (create_elf_fdpic_tables(bprm, current->mm, bprm 462 fs/binfmt_elf_fdpic.c finalize_exec(bprm); bprm 497 fs/binfmt_elf_fdpic.c static int create_elf_fdpic_tables(struct linux_binprm *bprm, bprm 517 fs/binfmt_elf_fdpic.c sp = arch_align_stack(bprm->p); bprm 522 fs/binfmt_elf_fdpic.c if (transfer_args_to_stack(bprm, &sp) < 0) bprm 592 fs/binfmt_elf_fdpic.c if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) bprm 597 fs/binfmt_elf_fdpic.c sp -= (bprm->envc + 1) * sizeof(char *); /* envv[] */ bprm 598 fs/binfmt_elf_fdpic.c sp -= (bprm->argc + 1) * sizeof(char *); /* argv[] */ bprm 632 fs/binfmt_elf_fdpic.c if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { bprm 635 fs/binfmt_elf_fdpic.c NEW_AUX_ENT(AT_EXECFD, bprm->interp_data); bprm 656 fs/binfmt_elf_fdpic.c NEW_AUX_ENT(AT_SECURE, bprm->secureexec); bprm 657 fs/binfmt_elf_fdpic.c NEW_AUX_ENT(AT_EXECFN, bprm->exec); bprm 671 fs/binfmt_elf_fdpic.c csp -= (bprm->envc + 1) * sizeof(elf_caddr_t); bprm 673 fs/binfmt_elf_fdpic.c csp -= (bprm->argc + 1) * sizeof(elf_caddr_t); bprm 678 fs/binfmt_elf_fdpic.c __put_user(bprm->argc, (unsigned long __user *) csp); bprm 684 fs/binfmt_elf_fdpic.c current->mm->arg_start = bprm->p; bprm 687 fs/binfmt_elf_fdpic.c (MAX_ARG_PAGES * PAGE_SIZE - bprm->p); bprm 691 fs/binfmt_elf_fdpic.c for (loop = bprm->argc; loop > 0; loop--) { bprm 703 fs/binfmt_elf_fdpic.c for (loop = bprm->envc; loop > 0; loop--) { bprm 26 fs/binfmt_em86.c static int load_em86(struct linux_binprm *bprm) bprm 35 fs/binfmt_em86.c elf_ex = *((struct elfhdr *)bprm->buf); bprm 43 fs/binfmt_em86.c !bprm->file->f_op->mmap) { bprm 48 fs/binfmt_em86.c if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) bprm 51 fs/binfmt_em86.c allow_write_access(bprm->file); bprm 52 fs/binfmt_em86.c fput(bprm->file); bprm 53 fs/binfmt_em86.c bprm->file = NULL; bprm 70 fs/binfmt_em86.c remove_arg_zero(bprm); bprm 71 fs/binfmt_em86.c retval = copy_strings_kernel(1, &bprm->filename, bprm); bprm 73 fs/binfmt_em86.c bprm->argc++; bprm 75 fs/binfmt_em86.c retval = copy_strings_kernel(1, &i_arg, bprm); bprm 77 fs/binfmt_em86.c bprm->argc++; bprm 79 fs/binfmt_em86.c retval = copy_strings_kernel(1, &i_name, bprm); bprm 81 fs/binfmt_em86.c bprm->argc++; bprm 92 fs/binfmt_em86.c bprm->file = file; bprm 94 fs/binfmt_em86.c retval = prepare_binprm(bprm); bprm 98 fs/binfmt_em86.c return search_binary_handler(bprm); bprm 123 fs/binfmt_flat.c static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start) bprm 132 fs/binfmt_flat.c sp -= bprm->envc + 1; bprm 133 fs/binfmt_flat.c sp -= bprm->argc + 1; bprm 141 fs/binfmt_flat.c __put_user(bprm->argc, sp++); bprm 145 fs/binfmt_flat.c envp = (unsigned long)(sp + 2 + bprm->argc + 1); bprm 151 fs/binfmt_flat.c for (i = bprm->argc; i > 0; i--) { bprm 162 fs/binfmt_flat.c for (i = bprm->envc; i > 0; i--) { bprm 192 fs/binfmt_flat.c static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst, bprm 213 fs/binfmt_flat.c ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); bprm 283 fs/binfmt_flat.c ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); bprm 425 fs/binfmt_flat.c static int load_flat_file(struct linux_binprm *bprm, bprm 440 fs/binfmt_flat.c hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ bprm 468 fs/binfmt_flat.c pr_info("Loading file: %s\n", bprm->filename); bprm 537 fs/binfmt_flat.c ret = flush_old_exec(bprm); bprm 543 fs/binfmt_flat.c setup_new_exec(bprm); bprm 564 fs/binfmt_flat.c textpos = vm_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, bprm 596 fs/binfmt_flat.c result = decompress_exec(bprm, fpos, (char *)datapos, bprm 601 fs/binfmt_flat.c result = read_code(bprm->file, datapos, fpos, bprm 645 fs/binfmt_flat.c result = decompress_exec(bprm, sizeof(struct flat_hdr), bprm 664 fs/binfmt_flat.c result = decompress_exec(bprm, sizeof(struct flat_hdr), bprm 676 fs/binfmt_flat.c result = read_code(bprm->file, textpos, 0, text_len); bprm 679 fs/binfmt_flat.c result = decompress_exec(bprm, text_len, (char *) datapos, bprm 686 fs/binfmt_flat.c result = decompress_exec(bprm, text_len, bprm 699 fs/binfmt_flat.c result = read_code(bprm->file, textpos, 0, text_len); bprm 701 fs/binfmt_flat.c result = read_code(bprm->file, datapos, bprm 741 fs/binfmt_flat.c id ? "Lib" : "Load", bprm->filename, bprm 886 fs/binfmt_flat.c struct linux_binprm bprm; bprm 891 fs/binfmt_flat.c memset(&bprm, 0, sizeof(bprm)); bprm 897 fs/binfmt_flat.c bprm.filename = buf; bprm 898 fs/binfmt_flat.c bprm.file = open_exec(bprm.filename); bprm 899 fs/binfmt_flat.c res = PTR_ERR(bprm.file); bprm 900 fs/binfmt_flat.c if (IS_ERR(bprm.file)) bprm 903 fs/binfmt_flat.c res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos); bprm 906 fs/binfmt_flat.c res = load_flat_file(&bprm, libs, id, NULL); bprm 908 fs/binfmt_flat.c allow_write_access(bprm.file); bprm 909 fs/binfmt_flat.c fput(bprm.file); bprm 922 fs/binfmt_flat.c static int load_flat_binary(struct linux_binprm *bprm) bprm 941 fs/binfmt_flat.c stack_len += PAGE_SIZE * MAX_ARG_PAGES - bprm->p; /* the strings */ bprm 943 fs/binfmt_flat.c stack_len += (bprm->argc + 1) * sizeof(char *); /* the argv array */ bprm 944 fs/binfmt_flat.c stack_len += (bprm->envc + 1) * sizeof(char *); /* the envp array */ bprm 947 fs/binfmt_flat.c res = load_flat_file(bprm, &libinfo, 0, &stack_len); bprm 966 fs/binfmt_flat.c install_exec_creds(bprm); bprm 971 fs/binfmt_flat.c res = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT); bprm 973 fs/binfmt_flat.c res = create_flat_tables(bprm, bprm->p); bprm 981 fs/binfmt_flat.c res = transfer_args_to_stack(bprm, ¤t->mm->start_stack); bprm 983 fs/binfmt_flat.c res = create_flat_tables(bprm, current->mm->start_stack); bprm 1011 fs/binfmt_flat.c finalize_exec(bprm); bprm 90 fs/binfmt_misc.c static Node *check_file(struct linux_binprm *bprm) bprm 92 fs/binfmt_misc.c char *p = strrchr(bprm->interp, '.'); bprm 113 fs/binfmt_misc.c s = bprm->buf + e->offset; bprm 132 fs/binfmt_misc.c static int load_misc_binary(struct linux_binprm *bprm) bprm 145 fs/binfmt_misc.c fmt = check_file(bprm); bprm 154 fs/binfmt_misc.c if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) bprm 158 fs/binfmt_misc.c retval = remove_arg_zero(bprm); bprm 174 fs/binfmt_misc.c fd_install(fd_binary, bprm->file); bprm 178 fs/binfmt_misc.c would_dump(bprm, bprm->file); bprm 180 fs/binfmt_misc.c allow_write_access(bprm->file); bprm 181 fs/binfmt_misc.c bprm->file = NULL; bprm 184 fs/binfmt_misc.c bprm->interp_flags |= BINPRM_FLAGS_EXECFD; bprm 185 fs/binfmt_misc.c bprm->interp_data = fd_binary; bprm 188 fs/binfmt_misc.c allow_write_access(bprm->file); bprm 189 fs/binfmt_misc.c fput(bprm->file); bprm 190 fs/binfmt_misc.c bprm->file = NULL; bprm 193 fs/binfmt_misc.c retval = copy_strings_kernel(1, &bprm->interp, bprm); bprm 196 fs/binfmt_misc.c bprm->argc++; bprm 199 fs/binfmt_misc.c retval = copy_strings_kernel(1, &fmt->interpreter, bprm); bprm 202 fs/binfmt_misc.c bprm->argc++; bprm 205 fs/binfmt_misc.c retval = bprm_change_interp(fmt->interpreter, bprm); bprm 220 fs/binfmt_misc.c bprm->file = interp_file; bprm 228 fs/binfmt_misc.c memset(bprm->buf, 0, BINPRM_BUF_SIZE); bprm 229 fs/binfmt_misc.c retval = kernel_read(bprm->file, bprm->buf, BINPRM_BUF_SIZE, bprm 232 fs/binfmt_misc.c retval = prepare_binprm(bprm); bprm 237 fs/binfmt_misc.c retval = search_binary_handler(bprm); bprm 247 fs/binfmt_misc.c bprm->interp_flags = 0; bprm 248 fs/binfmt_misc.c bprm->interp_data = 0; bprm 34 fs/binfmt_script.c static int load_script(struct linux_binprm *bprm) bprm 42 fs/binfmt_script.c if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) bprm 51 fs/binfmt_script.c if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) bprm 55 fs/binfmt_script.c allow_write_access(bprm->file); bprm 56 fs/binfmt_script.c fput(bprm->file); bprm 57 fs/binfmt_script.c bprm->file = NULL; bprm 73 fs/binfmt_script.c buf_end = bprm->buf + sizeof(bprm->buf) - 1; bprm 74 fs/binfmt_script.c cp = strnchr(bprm->buf, sizeof(bprm->buf), '\n'); bprm 76 fs/binfmt_script.c cp = next_non_spacetab(bprm->buf + 2, buf_end); bprm 89 fs/binfmt_script.c while (cp > bprm->buf) { bprm 96 fs/binfmt_script.c for (cp = bprm->buf+2; (*cp == ' ') || (*cp == '\t'); cp++); bprm 117 fs/binfmt_script.c retval = remove_arg_zero(bprm); bprm 120 fs/binfmt_script.c retval = copy_strings_kernel(1, &bprm->interp, bprm); bprm 123 fs/binfmt_script.c bprm->argc++; bprm 125 fs/binfmt_script.c retval = copy_strings_kernel(1, &i_arg, bprm); bprm 128 fs/binfmt_script.c bprm->argc++; bprm 130 fs/binfmt_script.c retval = copy_strings_kernel(1, &i_name, bprm); bprm 133 fs/binfmt_script.c bprm->argc++; bprm 134 fs/binfmt_script.c retval = bprm_change_interp(i_name, bprm); bprm 145 fs/binfmt_script.c bprm->file = file; bprm 146 fs/binfmt_script.c retval = prepare_binprm(bprm); bprm 149 fs/binfmt_script.c return search_binary_handler(bprm); bprm 183 fs/exec.c static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) bprm 186 fs/exec.c long diff = (long)(pages - bprm->vma_pages); bprm 191 fs/exec.c bprm->vma_pages = pages; bprm 195 fs/exec.c static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, bprm 204 fs/exec.c ret = expand_downwards(bprm->vma, pos); bprm 217 fs/exec.c ret = get_user_pages_remote(current, bprm->mm, pos, 1, gup_flags, bprm 223 fs/exec.c acct_arg_size(bprm, vma_pages(bprm->vma)); bprm 233 fs/exec.c static void free_arg_pages(struct linux_binprm *bprm) bprm 237 fs/exec.c static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, bprm 240 fs/exec.c flush_cache_page(bprm->vma, pos, page_to_pfn(page)); bprm 243 fs/exec.c static int __bprm_mm_init(struct linux_binprm *bprm) bprm 247 fs/exec.c struct mm_struct *mm = bprm->mm; bprm 249 fs/exec.c bprm->vma = vma = vm_area_alloc(mm); bprm 278 fs/exec.c bprm->p = vma->vm_end - sizeof(void *); bprm 283 fs/exec.c bprm->vma = NULL; bprm 288 fs/exec.c static bool valid_arg_len(struct linux_binprm *bprm, long len) bprm 295 fs/exec.c static inline void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) bprm 299 fs/exec.c static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, bprm 304 fs/exec.c page = bprm->page[pos / PAGE_SIZE]; bprm 309 fs/exec.c bprm->page[pos / PAGE_SIZE] = page; bprm 319 fs/exec.c static void free_arg_page(struct linux_binprm *bprm, int i) bprm 321 fs/exec.c if (bprm->page[i]) { bprm 322 fs/exec.c __free_page(bprm->page[i]); bprm 323 fs/exec.c bprm->page[i] = NULL; bprm 327 fs/exec.c static void free_arg_pages(struct linux_binprm *bprm) bprm 332 fs/exec.c free_arg_page(bprm, i); bprm 335 fs/exec.c static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, bprm 340 fs/exec.c static int __bprm_mm_init(struct linux_binprm *bprm) bprm 342 fs/exec.c bprm->p = PAGE_SIZE * MAX_ARG_PAGES - sizeof(void *); bprm 346 fs/exec.c static bool valid_arg_len(struct linux_binprm *bprm, long len) bprm 348 fs/exec.c return len <= bprm->p; bprm 359 fs/exec.c static int bprm_mm_init(struct linux_binprm *bprm) bprm 364 fs/exec.c bprm->mm = mm = mm_alloc(); bprm 371 fs/exec.c bprm->rlim_stack = current->signal->rlim[RLIMIT_STACK]; bprm 374 fs/exec.c err = __bprm_mm_init(bprm); bprm 382 fs/exec.c bprm->mm = NULL; bprm 451 fs/exec.c static int prepare_arg_pages(struct linux_binprm *bprm, bprm 456 fs/exec.c bprm->argc = count(argv, MAX_ARG_STRINGS); bprm 457 fs/exec.c if (bprm->argc < 0) bprm 458 fs/exec.c return bprm->argc; bprm 460 fs/exec.c bprm->envc = count(envp, MAX_ARG_STRINGS); bprm 461 fs/exec.c if (bprm->envc < 0) bprm 462 fs/exec.c return bprm->envc; bprm 473 fs/exec.c limit = min(limit, bprm->rlim_stack.rlim_cur / 4); bprm 486 fs/exec.c ptr_size = (bprm->argc + bprm->envc) * sizeof(void *); bprm 491 fs/exec.c bprm->argmin = bprm->p - limit; bprm 501 fs/exec.c struct linux_binprm *bprm) bprm 523 fs/exec.c if (!valid_arg_len(bprm, len)) bprm 527 fs/exec.c pos = bprm->p; bprm 529 fs/exec.c bprm->p -= len; bprm 531 fs/exec.c if (bprm->p < bprm->argmin) bprm 560 fs/exec.c page = get_arg_page(bprm, pos, 1); bprm 574 fs/exec.c flush_arg_page(bprm, kpos, kmapped_page); bprm 596 fs/exec.c struct linux_binprm *bprm) bprm 605 fs/exec.c r = copy_strings(argc, argv, bprm); bprm 691 fs/exec.c int setup_arg_pages(struct linux_binprm *bprm, bprm 698 fs/exec.c struct vm_area_struct *vma = bprm->vma; bprm 708 fs/exec.c stack_base = bprm->rlim_stack.rlim_max; bprm 722 fs/exec.c mm->arg_start = bprm->p - stack_shift; bprm 723 fs/exec.c bprm->p = vma->vm_end - stack_shift; bprm 734 fs/exec.c bprm->p -= stack_shift; bprm 735 fs/exec.c mm->arg_start = bprm->p; bprm 738 fs/exec.c if (bprm->loader) bprm 739 fs/exec.c bprm->loader -= stack_shift; bprm 740 fs/exec.c bprm->exec -= stack_shift; bprm 781 fs/exec.c rlim_stack = bprm->rlim_stack.rlim_cur & PAGE_MASK; bprm 793 fs/exec.c current->mm->start_stack = bprm->p; bprm 810 fs/exec.c int transfer_args_to_stack(struct linux_binprm *bprm, bprm 816 fs/exec.c stop = bprm->p >> PAGE_SHIFT; bprm 820 fs/exec.c unsigned int offset = index == stop ? bprm->p & ~PAGE_MASK : 0; bprm 821 fs/exec.c char *src = kmap(bprm->page[index]) + offset; bprm 825 fs/exec.c kunmap(bprm->page[index]); bprm 1258 fs/exec.c int flush_old_exec(struct linux_binprm * bprm) bprm 1275 fs/exec.c set_mm_exe_file(bprm->mm, bprm->file); bprm 1277 fs/exec.c would_dump(bprm, bprm->file); bprm 1282 fs/exec.c acct_arg_size(bprm, 0); bprm 1283 fs/exec.c retval = exec_mmap(bprm->mm); bprm 1293 fs/exec.c bprm->mm = NULL; bprm 1299 fs/exec.c current->personality &= ~bprm->per_clear; bprm 1315 fs/exec.c void would_dump(struct linux_binprm *bprm, struct file *file) bprm 1320 fs/exec.c bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP; bprm 1323 fs/exec.c user_ns = old = bprm->mm->user_ns; bprm 1329 fs/exec.c bprm->mm->user_ns = get_user_ns(user_ns); bprm 1336 fs/exec.c void setup_new_exec(struct linux_binprm * bprm) bprm 1343 fs/exec.c bprm->secureexec |= bprm->cap_elevated; bprm 1345 fs/exec.c if (bprm->secureexec) { bprm 1356 fs/exec.c if (bprm->rlim_stack.rlim_cur > _STK_LIM) bprm 1357 fs/exec.c bprm->rlim_stack.rlim_cur = _STK_LIM; bprm 1360 fs/exec.c arch_pick_mmap_layout(current->mm, &bprm->rlim_stack); bprm 1369 fs/exec.c if (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP || bprm 1378 fs/exec.c __set_task_comm(current, kbasename(bprm->filename), true); bprm 1394 fs/exec.c void finalize_exec(struct linux_binprm *bprm) bprm 1398 fs/exec.c current->signal->rlim[RLIMIT_STACK] = bprm->rlim_stack; bprm 1409 fs/exec.c static int prepare_bprm_creds(struct linux_binprm *bprm) bprm 1414 fs/exec.c bprm->cred = prepare_exec_creds(); bprm 1415 fs/exec.c if (likely(bprm->cred)) bprm 1422 fs/exec.c static void free_bprm(struct linux_binprm *bprm) bprm 1424 fs/exec.c free_arg_pages(bprm); bprm 1425 fs/exec.c if (bprm->cred) { bprm 1427 fs/exec.c abort_creds(bprm->cred); bprm 1429 fs/exec.c if (bprm->file) { bprm 1430 fs/exec.c allow_write_access(bprm->file); bprm 1431 fs/exec.c fput(bprm->file); bprm 1434 fs/exec.c if (bprm->interp != bprm->filename) bprm 1435 fs/exec.c kfree(bprm->interp); bprm 1436 fs/exec.c kfree(bprm); bprm 1439 fs/exec.c int bprm_change_interp(const char *interp, struct linux_binprm *bprm) bprm 1442 fs/exec.c if (bprm->interp != bprm->filename) bprm 1443 fs/exec.c kfree(bprm->interp); bprm 1444 fs/exec.c bprm->interp = kstrdup(interp, GFP_KERNEL); bprm 1445 fs/exec.c if (!bprm->interp) bprm 1454 fs/exec.c void install_exec_creds(struct linux_binprm *bprm) bprm 1456 fs/exec.c security_bprm_committing_creds(bprm); bprm 1458 fs/exec.c commit_creds(bprm->cred); bprm 1459 fs/exec.c bprm->cred = NULL; bprm 1474 fs/exec.c security_bprm_committed_creds(bprm); bprm 1484 fs/exec.c static void check_unsafe_exec(struct linux_binprm *bprm) bprm 1490 fs/exec.c bprm->unsafe |= LSM_UNSAFE_PTRACE; bprm 1497 fs/exec.c bprm->unsafe |= LSM_UNSAFE_NO_NEW_PRIVS; bprm 1510 fs/exec.c bprm->unsafe |= LSM_UNSAFE_SHARE; bprm 1516 fs/exec.c static void bprm_fill_uid(struct linux_binprm *bprm) bprm 1529 fs/exec.c bprm->cred->euid = current_euid(); bprm 1530 fs/exec.c bprm->cred->egid = current_egid(); bprm 1532 fs/exec.c if (!mnt_may_suid(bprm->file->f_path.mnt)) bprm 1538 fs/exec.c inode = bprm->file->f_path.dentry->d_inode; bprm 1553 fs/exec.c if (!kuid_has_mapping(bprm->cred->user_ns, uid) || bprm 1554 fs/exec.c !kgid_has_mapping(bprm->cred->user_ns, gid)) bprm 1558 fs/exec.c bprm->per_clear |= PER_CLEAR_ON_SETID; bprm 1559 fs/exec.c bprm->cred->euid = uid; bprm 1563 fs/exec.c bprm->per_clear |= PER_CLEAR_ON_SETID; bprm 1564 fs/exec.c bprm->cred->egid = gid; bprm 1574 fs/exec.c int prepare_binprm(struct linux_binprm *bprm) bprm 1579 fs/exec.c bprm_fill_uid(bprm); bprm 1582 fs/exec.c retval = security_bprm_set_creds(bprm); bprm 1585 fs/exec.c bprm->called_set_creds = 1; bprm 1587 fs/exec.c memset(bprm->buf, 0, BINPRM_BUF_SIZE); bprm 1588 fs/exec.c return kernel_read(bprm->file, bprm->buf, BINPRM_BUF_SIZE, &pos); bprm 1598 fs/exec.c int remove_arg_zero(struct linux_binprm *bprm) bprm 1605 fs/exec.c if (!bprm->argc) bprm 1609 fs/exec.c offset = bprm->p & ~PAGE_MASK; bprm 1610 fs/exec.c page = get_arg_page(bprm, bprm->p, 0); bprm 1618 fs/exec.c offset++, bprm->p++) bprm 1625 fs/exec.c bprm->p++; bprm 1626 fs/exec.c bprm->argc--; bprm 1638 fs/exec.c int search_binary_handler(struct linux_binprm *bprm) bprm 1645 fs/exec.c if (bprm->recursion_depth > 5) bprm 1648 fs/exec.c retval = security_bprm_check(bprm); bprm 1660 fs/exec.c bprm->recursion_depth++; bprm 1661 fs/exec.c retval = fmt->load_binary(bprm); bprm 1662 fs/exec.c bprm->recursion_depth--; bprm 1666 fs/exec.c if (retval < 0 && !bprm->mm) { bprm 1672 fs/exec.c if (retval != -ENOEXEC || !bprm->file) { bprm 1680 fs/exec.c if (printable(bprm->buf[0]) && printable(bprm->buf[1]) && bprm 1681 fs/exec.c printable(bprm->buf[2]) && printable(bprm->buf[3])) bprm 1683 fs/exec.c if (request_module("binfmt-%04x", *(ushort *)(bprm->buf + 2)) < 0) bprm 1693 fs/exec.c static int exec_binprm(struct linux_binprm *bprm) bprm 1704 fs/exec.c ret = search_binary_handler(bprm); bprm 1706 fs/exec.c audit_bprm(bprm); bprm 1707 fs/exec.c trace_sched_process_exec(current, old_pid, bprm); bprm 1724 fs/exec.c struct linux_binprm *bprm; bprm 1752 fs/exec.c bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); bprm 1753 fs/exec.c if (!bprm) bprm 1756 fs/exec.c retval = prepare_bprm_creds(bprm); bprm 1760 fs/exec.c check_unsafe_exec(bprm); bprm 1771 fs/exec.c bprm->file = file; bprm 1773 fs/exec.c bprm->filename = "none"; bprm 1775 fs/exec.c bprm->filename = filename->name; bprm 1792 fs/exec.c bprm->interp_flags |= BINPRM_FLAGS_PATH_INACCESSIBLE; bprm 1793 fs/exec.c bprm->filename = pathbuf; bprm 1795 fs/exec.c bprm->interp = bprm->filename; bprm 1797 fs/exec.c retval = bprm_mm_init(bprm); bprm 1801 fs/exec.c retval = prepare_arg_pages(bprm, argv, envp); bprm 1805 fs/exec.c retval = prepare_binprm(bprm); bprm 1809 fs/exec.c retval = copy_strings_kernel(1, &bprm->filename, bprm); bprm 1813 fs/exec.c bprm->exec = bprm->p; bprm 1814 fs/exec.c retval = copy_strings(bprm->envc, envp, bprm); bprm 1818 fs/exec.c retval = copy_strings(bprm->argc, argv, bprm); bprm 1822 fs/exec.c retval = exec_binprm(bprm); bprm 1832 fs/exec.c free_bprm(bprm); bprm 1841 fs/exec.c if (bprm->mm) { bprm 1842 fs/exec.c acct_arg_size(bprm, 0); bprm 1843 fs/exec.c mmput(bprm->mm); bprm 1851 fs/exec.c free_bprm(bprm); bprm 364 include/linux/audit.h extern void __audit_bprm(struct linux_binprm *bprm); bprm 372 include/linux/audit.h extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, bprm 397 include/linux/audit.h static inline void audit_bprm(struct linux_binprm *bprm) bprm 400 include/linux/audit.h __audit_bprm(bprm); bprm 449 include/linux/audit.h static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, bprm 454 include/linux/audit.h return __audit_log_bprm_fcaps(bprm, new, old); bprm 581 include/linux/audit.h static inline void audit_bprm(struct linux_binprm *bprm) bprm 610 include/linux/audit.h static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, bprm 123 include/linux/binfmts.h extern int flush_old_exec(struct linux_binprm * bprm); bprm 124 include/linux/binfmts.h extern void setup_new_exec(struct linux_binprm * bprm); bprm 125 include/linux/binfmts.h extern void finalize_exec(struct linux_binprm *bprm); bprm 135 include/linux/binfmts.h extern int setup_arg_pages(struct linux_binprm * bprm, bprm 138 include/linux/binfmts.h extern int transfer_args_to_stack(struct linux_binprm *bprm, bprm 140 include/linux/binfmts.h extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm); bprm 142 include/linux/binfmts.h struct linux_binprm *bprm); bprm 143 include/linux/binfmts.h extern void install_exec_creds(struct linux_binprm *bprm); bprm 16 include/linux/ima.h extern int ima_bprm_check(struct linux_binprm *bprm); bprm 48 include/linux/ima.h static inline int ima_bprm_check(struct linux_binprm *bprm) bprm 1487 include/linux/lsm_hooks.h int (*bprm_set_creds)(struct linux_binprm *bprm); bprm 1488 include/linux/lsm_hooks.h int (*bprm_check_security)(struct linux_binprm *bprm); bprm 1489 include/linux/lsm_hooks.h void (*bprm_committing_creds)(struct linux_binprm *bprm); bprm 1490 include/linux/lsm_hooks.h void (*bprm_committed_creds)(struct linux_binprm *bprm); bprm 142 include/linux/security.h extern int cap_bprm_set_creds(struct linux_binprm *bprm); bprm 278 include/linux/security.h int security_bprm_set_creds(struct linux_binprm *bprm); bprm 279 include/linux/security.h int security_bprm_check(struct linux_binprm *bprm); bprm 280 include/linux/security.h void security_bprm_committing_creds(struct linux_binprm *bprm); bprm 281 include/linux/security.h void security_bprm_committed_creds(struct linux_binprm *bprm); bprm 571 include/linux/security.h static inline int security_bprm_set_creds(struct linux_binprm *bprm) bprm 573 include/linux/security.h return cap_bprm_set_creds(bprm); bprm 576 include/linux/security.h static inline int security_bprm_check(struct linux_binprm *bprm) bprm 581 include/linux/security.h static inline void security_bprm_committing_creds(struct linux_binprm *bprm) bprm 585 include/linux/security.h static inline void security_bprm_committed_creds(struct linux_binprm *bprm) bprm 318 include/trace/events/sched.h struct linux_binprm *bprm), bprm 320 include/trace/events/sched.h TP_ARGS(p, old_pid, bprm), bprm 323 include/trace/events/sched.h __string( filename, bprm->filename ) bprm 329 include/trace/events/sched.h __assign_str(filename, bprm->filename); bprm 2304 kernel/auditsc.c void __audit_bprm(struct linux_binprm *bprm) bprm 2309 kernel/auditsc.c context->execve.argc = bprm->argc; bprm 2441 kernel/auditsc.c int __audit_log_bprm_fcaps(struct linux_binprm *bprm, bprm 2456 kernel/auditsc.c get_vfs_caps_from_disk(bprm->file->f_path.dentry, &vcaps); bprm 309 security/apparmor/domain.c static int aa_xattrs_match(const struct linux_binprm *bprm, bprm 318 security/apparmor/domain.c if (!bprm || !profile->xattr_count) bprm 325 security/apparmor/domain.c d = bprm->file->f_path.dentry; bprm 381 security/apparmor/domain.c static struct aa_label *find_attach(const struct linux_binprm *bprm, bprm 424 security/apparmor/domain.c if (bprm && profile->xattr_count) { bprm 430 security/apparmor/domain.c ret = aa_xattrs_match(bprm, profile, bprm 551 security/apparmor/domain.c const struct linux_binprm *bprm, bprm 579 security/apparmor/domain.c new = find_attach(bprm, ns, &profile->base.profiles, bprm 583 security/apparmor/domain.c new = find_attach(bprm, ns, &ns->base.profiles, bprm 618 security/apparmor/domain.c const struct linux_binprm *bprm, bprm 632 security/apparmor/domain.c AA_BUG(!bprm); bprm 635 security/apparmor/domain.c error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, bprm 644 security/apparmor/domain.c name = bprm->filename; bprm 649 security/apparmor/domain.c new = find_attach(bprm, profile->ns, bprm 663 security/apparmor/domain.c new = x_to_label(profile, bprm, name, perms.xindex, &target, bprm 678 security/apparmor/domain.c if (aa_xattrs_match(bprm, component, state) < bprm 744 security/apparmor/domain.c bool stack, const struct linux_binprm *bprm, bprm 755 security/apparmor/domain.c AA_BUG(!bprm); bprm 768 security/apparmor/domain.c error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, bprm 776 security/apparmor/domain.c xname = bprm->filename; bprm 817 security/apparmor/domain.c const struct linux_binprm *bprm, bprm 827 security/apparmor/domain.c AA_BUG(!bprm); bprm 833 security/apparmor/domain.c bprm, buffer, cond, unsafe)); bprm 838 security/apparmor/domain.c profile_transition(profile, bprm, buffer, bprm 844 security/apparmor/domain.c profile_onexec(profile, onexec, stack, bprm, bprm 851 security/apparmor/domain.c profile_transition(profile, bprm, buffer, bprm 861 security/apparmor/domain.c AA_MAY_ONEXEC, bprm->filename, NULL, bprm 875 security/apparmor/domain.c int apparmor_bprm_set_creds(struct linux_binprm *bprm) bprm 885 security/apparmor/domain.c file_inode(bprm->file)->i_uid, bprm 886 security/apparmor/domain.c file_inode(bprm->file)->i_mode bprm 889 security/apparmor/domain.c if (bprm->called_set_creds) bprm 893 security/apparmor/domain.c AA_BUG(!cred_label(bprm->cred)); bprm 896 security/apparmor/domain.c label = aa_get_newest_label(cred_label(bprm->cred)); bprm 905 security/apparmor/domain.c if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && !unconfined(label) && bprm 914 security/apparmor/domain.c bprm, buffer, &cond, &unsafe); bprm 917 security/apparmor/domain.c profile_transition(profile, bprm, buffer, bprm 937 security/apparmor/domain.c if ((bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS) && bprm 944 security/apparmor/domain.c if (bprm->unsafe & LSM_UNSAFE_SHARE) { bprm 949 security/apparmor/domain.c if (bprm->unsafe & (LSM_UNSAFE_PTRACE)) { bprm 959 security/apparmor/domain.c "label=", bprm->filename); bprm 963 security/apparmor/domain.c bprm->secureexec = 1; bprm 970 security/apparmor/domain.c "bits. %s label=", bprm->filename); bprm 974 security/apparmor/domain.c bprm->per_clear |= PER_CLEAR_ON_SETID; bprm 976 security/apparmor/domain.c aa_put_label(cred_label(bprm->cred)); bprm 978 security/apparmor/domain.c set_cred_label(bprm->cred, new); bprm 989 security/apparmor/domain.c bprm->filename, NULL, new, bprm 990 security/apparmor/domain.c file_inode(bprm->file)->i_uid, info, bprm 33 security/apparmor/include/domain.h int apparmor_bprm_set_creds(struct linux_binprm *bprm); bprm 679 security/apparmor/lsm.c static void apparmor_bprm_committing_creds(struct linux_binprm *bprm) bprm 682 security/apparmor/lsm.c struct aa_label *new_label = cred_label(bprm->cred); bprm 689 security/apparmor/lsm.c aa_inherit_files(bprm->cred, current->files); bprm 701 security/apparmor/lsm.c static void apparmor_bprm_committed_creds(struct linux_binprm *bprm) bprm 529 security/commoncap.c struct linux_binprm *bprm, bprm 533 security/commoncap.c struct cred *new = bprm->cred; bprm 650 security/commoncap.c static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_fcap) bprm 655 security/commoncap.c cap_clear(bprm->cred->cap_permitted); bprm 660 security/commoncap.c if (!mnt_may_suid(bprm->file->f_path.mnt)) bprm 668 security/commoncap.c if (!current_in_userns(bprm->file->f_path.mnt->mnt_sb->s_user_ns)) bprm 671 security/commoncap.c rc = get_vfs_caps_from_disk(bprm->file->f_path.dentry, &vcaps); bprm 675 security/commoncap.c bprm->filename); bprm 681 security/commoncap.c rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap); bprm 685 security/commoncap.c cap_clear(bprm->cred->cap_permitted); bprm 713 security/commoncap.c static void handle_privileged_root(struct linux_binprm *bprm, bool has_fcap, bprm 717 security/commoncap.c struct cred *new = bprm->cred; bprm 727 security/commoncap.c warn_setuid_and_fcaps_mixed(bprm->filename); bprm 807 security/commoncap.c int cap_bprm_set_creds(struct linux_binprm *bprm) bprm 810 security/commoncap.c struct cred *new = bprm->cred; bprm 819 security/commoncap.c ret = get_file_caps(bprm, &effective, &has_fcap); bprm 825 security/commoncap.c handle_privileged_root(bprm, has_fcap, &effective, root_uid); bprm 829 security/commoncap.c bprm->per_clear |= PER_CLEAR_ON_SETID; bprm 839 security/commoncap.c ((bprm->unsafe & ~LSM_UNSAFE_PTRACE) || bprm 843 security/commoncap.c (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS)) { bprm 877 security/commoncap.c ret = audit_log_bprm_fcaps(bprm, new, old); bprm 888 security/commoncap.c bprm->cap_elevated = 0; bprm 893 security/commoncap.c bprm->cap_elevated = 1; bprm 407 security/integrity/ima/ima_main.c int ima_bprm_check(struct linux_binprm *bprm) bprm 413 security/integrity/ima/ima_main.c ret = process_measurement(bprm->file, current_cred(), secid, NULL, 0, bprm 418 security/integrity/ima/ima_main.c security_cred_getsecid(bprm->cred, &secid); bprm 419 security/integrity/ima/ima_main.c return process_measurement(bprm->file, bprm->cred, secid, NULL, 0, bprm 775 security/security.c int security_bprm_set_creds(struct linux_binprm *bprm) bprm 777 security/security.c return call_int_hook(bprm_set_creds, 0, bprm); bprm 780 security/security.c int security_bprm_check(struct linux_binprm *bprm) bprm 784 security/security.c ret = call_int_hook(bprm_check_security, 0, bprm); bprm 787 security/security.c return ima_bprm_check(bprm); bprm 790 security/security.c void security_bprm_committing_creds(struct linux_binprm *bprm) bprm 792 security/security.c call_void_hook(bprm_committing_creds, bprm); bprm 795 security/security.c void security_bprm_committed_creds(struct linux_binprm *bprm) bprm 797 security/security.c call_void_hook(bprm_committed_creds, bprm); bprm 2275 security/selinux/hooks.c static int check_nnp_nosuid(const struct linux_binprm *bprm, bprm 2279 security/selinux/hooks.c int nnp = (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS); bprm 2280 security/selinux/hooks.c int nosuid = !mnt_may_suid(bprm->file->f_path.mnt); bprm 2329 security/selinux/hooks.c static int selinux_bprm_set_creds(struct linux_binprm *bprm) bprm 2335 security/selinux/hooks.c struct inode *inode = file_inode(bprm->file); bprm 2340 security/selinux/hooks.c if (bprm->called_set_creds) bprm 2344 security/selinux/hooks.c new_tsec = selinux_cred(bprm->cred); bprm 2362 security/selinux/hooks.c rc = check_nnp_nosuid(bprm, old_tsec, new_tsec); bprm 2377 security/selinux/hooks.c rc = check_nnp_nosuid(bprm, old_tsec, new_tsec); bprm 2383 security/selinux/hooks.c ad.u.file = bprm->file; bprm 2406 security/selinux/hooks.c if (bprm->unsafe & LSM_UNSAFE_SHARE) { bprm 2417 security/selinux/hooks.c if (bprm->unsafe & LSM_UNSAFE_PTRACE) { bprm 2430 security/selinux/hooks.c bprm->per_clear |= PER_CLEAR_ON_SETID; bprm 2439 security/selinux/hooks.c bprm->secureexec |= !!rc; bprm 2502 security/selinux/hooks.c static void selinux_bprm_committing_creds(struct linux_binprm *bprm) bprm 2508 security/selinux/hooks.c new_tsec = selinux_cred(bprm->cred); bprm 2513 security/selinux/hooks.c flush_unauthorized_files(bprm->cred, current->files); bprm 2549 security/selinux/hooks.c static void selinux_bprm_committed_creds(struct linux_binprm *bprm) bprm 903 security/smack/smack_lsm.c static int smack_bprm_set_creds(struct linux_binprm *bprm) bprm 905 security/smack/smack_lsm.c struct inode *inode = file_inode(bprm->file); bprm 906 security/smack/smack_lsm.c struct task_smack *bsp = smack_cred(bprm->cred); bprm 911 security/smack/smack_lsm.c if (bprm->called_set_creds) bprm 923 security/smack/smack_lsm.c if (bprm->unsafe & LSM_UNSAFE_PTRACE) { bprm 939 security/smack/smack_lsm.c if (bprm->unsafe & ~LSM_UNSAFE_PTRACE) bprm 943 security/smack/smack_lsm.c bprm->per_clear |= PER_CLEAR_ON_SETID; bprm 947 security/smack/smack_lsm.c bprm->secureexec = 1; bprm 22 security/tomoyo/audit.c static char *tomoyo_print_bprm(struct linux_binprm *bprm, bprm 30 security/tomoyo/audit.c unsigned long pos = bprm->p; bprm 32 security/tomoyo/audit.c int argv_count = bprm->argc; bprm 33 security/tomoyo/audit.c int envp_count = bprm->envc; bprm 46 security/tomoyo/audit.c if (!tomoyo_dump_page(bprm, pos, dump)) bprm 261 security/tomoyo/audit.c struct file *file = r->ee->bprm->file; bprm 264 security/tomoyo/audit.c bprm_info = tomoyo_print_bprm(r->ee->bprm, &r->ee->dump); bprm 281 security/tomoyo/audit.c struct linux_binprm *bprm = r->ee->bprm; bprm 285 security/tomoyo/audit.c realpath, bprm->argc, bprm->envc, bprm_info); bprm 624 security/tomoyo/common.h struct linux_binprm *bprm; bprm 938 security/tomoyo/common.h bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos, bprm 976 security/tomoyo/common.h int tomoyo_find_next_domain(struct linux_binprm *bprm); bprm 109 security/tomoyo/condition.c struct linux_binprm *bprm = ee->bprm; bprm 113 security/tomoyo/condition.c unsigned long pos = bprm->p; bprm 115 security/tomoyo/condition.c int argv_count = bprm->argc; bprm 116 security/tomoyo/condition.c int envp_count = bprm->envc; bprm 130 security/tomoyo/condition.c if (!tomoyo_dump_page(bprm, pos, dump)) { bprm 160 security/tomoyo/condition.c if (!tomoyo_argv(bprm->argc - argv_count, bprm 780 security/tomoyo/condition.c struct linux_binprm *bprm = NULL; bprm 789 security/tomoyo/condition.c bprm = r->ee->bprm; bprm 790 security/tomoyo/condition.c if (!bprm && (argc || envc)) bprm 826 security/tomoyo/condition.c file = ee ? ee->bprm->file : NULL; bprm 928 security/tomoyo/condition.c if (!bprm) bprm 930 security/tomoyo/condition.c value = bprm->argc; bprm 933 security/tomoyo/condition.c if (!bprm) bprm 935 security/tomoyo/condition.c value = bprm->envc; bprm 618 security/tomoyo/domain.c struct linux_binprm *bprm = ee->bprm; bprm 623 security/tomoyo/domain.c unsigned long pos = bprm->p; bprm 625 security/tomoyo/domain.c int argv_count = bprm->argc; bprm 626 security/tomoyo/domain.c int envp_count = bprm->envc; bprm 639 security/tomoyo/domain.c if (!tomoyo_dump_page(bprm, pos, &env_page)) bprm 703 security/tomoyo/domain.c int tomoyo_find_next_domain(struct linux_binprm *bprm) bprm 707 security/tomoyo/domain.c const char *original_name = bprm->filename; bprm 724 security/tomoyo/domain.c ee->bprm = bprm; bprm 726 security/tomoyo/domain.c ee->obj.path1 = bprm->file->f_path; bprm 898 security/tomoyo/domain.c bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos, bprm 917 security/tomoyo/domain.c if (get_user_pages_remote(current, bprm->mm, pos, 1, bprm 921 security/tomoyo/domain.c page = bprm->page[pos / PAGE_SIZE]; bprm 55 security/tomoyo/tomoyo.c static void tomoyo_bprm_committed_creds(struct linux_binprm *bprm) bprm 72 security/tomoyo/tomoyo.c static int tomoyo_bprm_set_creds(struct linux_binprm *bprm) bprm 78 security/tomoyo/tomoyo.c if (bprm->called_set_creds) bprm 85 security/tomoyo/tomoyo.c tomoyo_load_policy(bprm->filename); bprm 97 security/tomoyo/tomoyo.c static int tomoyo_bprm_check_security(struct linux_binprm *bprm) bprm 107 security/tomoyo/tomoyo.c const int err = tomoyo_find_next_domain(bprm); bprm 116 security/tomoyo/tomoyo.c &bprm->file->f_path, O_RDONLY);