/linux/fs/ |
A D | exec.c | 503 bprm->argmin = bprm->p - limit; in bprm_stack_limits() 543 if (bprm->p < bprm->argmin) in copy_strings() 1278 would_dump(bprm, bprm->file); in begin_new_exec() 1280 would_dump(bprm, bprm->executable); in begin_new_exec() 1495 if (bprm->interp != bprm->filename) in free_bprm() 1519 bprm->filename = bprm->fdpath; in alloc_bprm() 1521 bprm->interp = bprm->filename; in alloc_bprm() 1537 if (bprm->interp != bprm->filename) in bprm_change_interp() 1771 bprm->file = bprm->interpreter; in exec_binprm() 1912 bprm->exec = bprm->p; in do_execveat_common() [all …]
|
A D | binfmt_script.c | 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() 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 …]
|
A D | binfmt_flat.c | 138 sp -= bprm->envc + 1; in create_flat_tables() 139 sp -= bprm->argc + 1; in create_flat_tables() 554 setup_new_exec(bprm); in load_flat_file() 908 memset(&bprm, 0, sizeof(bprm)); in load_flat_shared_library() 914 bprm.filename = buf; in load_flat_shared_library() 915 bprm.file = open_exec(bprm.filename); in load_flat_shared_library() 917 if (IS_ERR(bprm.file)) in load_flat_shared_library() 920 res = kernel_read(bprm.file, bprm.buf, BINPRM_BUF_SIZE, &pos); in load_flat_shared_library() 926 fput(bprm.file); in load_flat_shared_library() 988 res = create_flat_tables(bprm, bprm->p); in load_flat_binary() [all …]
|
A D | binfmt_aout.c | 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() 138 if (!bprm->file->f_op->mmap) in load_aout_binary() 154 retval = begin_new_exec(bprm); in load_aout_binary() 164 setup_new_exec(bprm); in load_aout_binary() 210 bprm->file); in load_aout_binary() 245 (unsigned long) create_aout_tables((char __user *) bprm->p, bprm); in load_aout_binary() [all …]
|
A 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() 144 fmt = check_file(bprm); in load_misc_binary() 159 retval = remove_arg_zero(bprm); in load_misc_binary() 165 bprm->have_execfd = 1; in load_misc_binary() 168 retval = copy_string_kernel(bprm->interp, bprm); in load_misc_binary() 171 bprm->argc++; in load_misc_binary() 177 bprm->argc++; in load_misc_binary() 195 bprm->interpreter = interp_file; in load_misc_binary() [all …]
|
A D | binfmt_elf_fdpic.c | 274 would_dump(bprm, interpreter); in load_elf_fdpic_binary() 341 retval = begin_new_exec(bprm); in load_elf_fdpic_binary() 355 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 …]
|
A D | binfmt_elf.c | 177 unsigned long p = bprm->p; in create_elf_tables() 178 int argc = bprm->argc; in create_elf_tables() 179 int envc = bprm->envc; in create_elf_tables() 286 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() 1014 setup_new_exec(bprm); in load_elf_binary() 1280 mm->start_stack = bprm->p; in load_elf_binary() [all …]
|
A D | compat_binfmt_elf.c | 114 #define COMPAT_ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \ argument 115 compat_arch_setup_additional_pages(bprm, interpreter)
|
/linux/security/apparmor/ |
A D | domain.c | 326 d = bprm->file->f_path.dentry; in aa_xattrs_match() 637 AA_BUG(!bprm); in profile_transition() 649 name = bprm->filename; in profile_transition() 734 AA_BUG(!bprm); in profile_onexec() 755 xname = bprm->filename; in profile_onexec() 806 AA_BUG(!bprm); in handle_onexec() 867 file_inode(bprm->file)->i_mode in apparmor_bprm_creds_for_exec() 871 AA_BUG(!cred_label(bprm->cred)); in apparmor_bprm_creds_for_exec() 943 "label=", bprm->filename); in apparmor_bprm_creds_for_exec() 947 bprm->secureexec = 1; in apparmor_bprm_creds_for_exec() [all …]
|
/linux/arch/x86/ia32/ |
A D | ia32_aout.c | 66 int argc = bprm->argc, envc = bprm->envc; in create_aout_tables() 104 static int load_aout_binary(struct linux_binprm *bprm) in load_aout_binary() argument 111 ex = *((struct exec *) bprm->buf); /* exec-header */ in load_aout_binary() 115 i_size_read(file_inode(bprm->file)) < in load_aout_binary() 133 retval = begin_new_exec(bprm); in load_aout_binary() 141 setup_new_exec(bprm); in load_aout_binary() 169 error = read_code(bprm->file, text_addr, 32, in load_aout_binary() 188 bprm->file); in load_aout_binary() 198 read_code(bprm->file, N_TXTADDR(ex), fd_offset, in load_aout_binary() 203 error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text, in load_aout_binary() [all …]
|
/linux/arch/alpha/kernel/ |
A D | binfmt_loader.c | 9 static int load_binary(struct linux_binprm *bprm) in load_binary() argument 11 struct exec *eh = (struct exec *)bprm->buf; in load_binary() 19 if (bprm->loader) in load_binary() 22 loader = bprm->vma->vm_end - sizeof(void *); in load_binary() 30 bprm->taso = eh->ah.entry < 0x100000000UL; in load_binary() 32 bprm->interpreter = file; in load_binary() 33 bprm->loader = loader; in load_binary()
|
/linux/include/linux/ |
A D | binfmts.h | 121 extern int begin_new_exec(struct linux_binprm * bprm); 122 extern void setup_new_exec(struct linux_binprm * bprm); 123 extern void finalize_exec(struct linux_binprm *bprm); 133 extern int setup_arg_pages(struct linux_binprm * bprm, 136 extern int transfer_args_to_stack(struct linux_binprm *bprm, 138 extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm); 139 int copy_string_kernel(const char *arg, struct linux_binprm *bprm);
|
A D | audit.h | 407 extern void __audit_bprm(struct linux_binprm *bprm); 415 extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, 443 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument 446 __audit_bprm(bprm); in audit_bprm() 495 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument 500 return __audit_log_bprm_fcaps(bprm, new, old); in audit_log_bprm_fcaps() 641 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument 670 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
|
/linux/security/tomoyo/ |
A D | audit.c | 22 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()
|
A D | domain.c | 616 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() 917 mmap_read_lock(bprm->mm); in tomoyo_dump_page() 920 mmap_read_unlock(bprm->mm); in tomoyo_dump_page() [all …]
|
A D | condition.c | 109 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 …]
|
A D | tomoyo.c | 55 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()
|
/linux/security/ |
A D | commoncap.c | 590 struct linux_binprm *bprm, in bprm_caps_from_vfs_caps() argument 594 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps() 732 cap_clear(bprm->cred->cap_permitted); in get_file_caps() 753 bprm->filename); in get_file_caps() 763 cap_clear(bprm->cred->cap_permitted); in get_file_caps() 795 struct cred *new = bprm->cred; in handle_privileged_root() 892 struct cred *new = bprm->cred; in cap_bprm_creds_from_file() 910 bprm->per_clear |= PER_CLEAR_ON_SETID; in cap_bprm_creds_from_file() 920 ((bprm->unsafe & ~LSM_UNSAFE_PTRACE) || in cap_bprm_creds_from_file() 958 ret = audit_log_bprm_fcaps(bprm, new, old); in cap_bprm_creds_from_file() [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
A D | bprm_opts.c | 22 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()
|
A D | ima.c | 22 void BPF_PROG(ima, struct linux_binprm *bprm) in BPF_PROG() argument 31 ret = bpf_ima_inode_hash(bprm->file->f_inode, &ima_hash, in BPF_PROG()
|
A D | local_storage.c | 158 void BPF_PROG(exec, struct linux_binprm *bprm) in BPF_PROG() argument 171 storage->exec_inode = bprm->file->f_inode; in BPF_PROG() 175 storage = bpf_inode_storage_get(&inode_storage_map, bprm->file->f_inode, in BPF_PROG()
|
A D | lsm.c | 108 int BPF_PROG(test_void_hook, struct linux_binprm *bprm) in BPF_PROG() argument 119 bpf_copy_from_user(args, sizeof(args), (void *)bprm->vma->vm_mm->arg_start); in BPF_PROG() 120 bpf_copy_from_user(args, sizeof(args), (void *)bprm->mm->arg_start); in BPF_PROG()
|
/linux/arch/arm64/kernel/ |
A D | vdso.c | 216 struct linux_binprm *bprm, in __setup_additional_pages() argument 414 int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in aarch32_setup_additional_pages() argument 427 ret = __setup_additional_pages(VDSO_ABI_AA32, mm, bprm, in aarch32_setup_additional_pages() 465 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument 473 ret = __setup_additional_pages(VDSO_ABI_AA64, mm, bprm, uses_interp); in arch_setup_additional_pages()
|
/linux/arch/riscv/kernel/ |
A D | vdso.c | 216 struct linux_binprm *bprm, in __setup_additional_pages() argument 256 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument 264 ret = __setup_additional_pages(mm, bprm, uses_interp); in arch_setup_additional_pages()
|
/linux/arch/x86/include/asm/ |
A D | elf.h | 387 extern int arch_setup_additional_pages(struct linux_binprm *bprm, 389 extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm, 391 #define COMPAT_ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \ argument 392 compat_arch_setup_additional_pages(bprm, interpreter, \
|