| /linux/fs/ |
| H A D | exec.c | 86 static int bprm_creds_from_file(struct linux_binprm *bprm); 128 * The nascent bprm->mm is not visible until exec_mmap() but it can 133 static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) in acct_arg_size() argument 136 long diff = (long)(pages - bprm->vma_pages); in acct_arg_size() 141 bprm->vma_pages = pages; in acct_arg_size() 145 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, in get_arg_page() argument 149 struct vm_area_struct *vma = bprm->vma; in get_arg_page() 150 struct mm_struct *mm = bprm->mm; in get_arg_page() 173 acct_arg_size(bprm, vma_pages(vma)); in get_arg_page() 183 static void free_arg_pages(struct linux_binprm *bprm) in free_arg_pages() argument 187 flush_arg_page(struct linux_binprm * bprm,unsigned long pos,struct page * page) flush_arg_page() argument 193 valid_arg_len(struct linux_binprm * bprm,long len) valid_arg_len() argument 200 acct_arg_size(struct linux_binprm * bprm,unsigned long pages) acct_arg_size() argument 204 get_arg_page(struct linux_binprm * bprm,unsigned long pos,int write) get_arg_page() argument 224 free_arg_page(struct linux_binprm * bprm,int i) free_arg_page() argument 232 free_arg_pages(struct linux_binprm * bprm) free_arg_pages() argument 240 flush_arg_page(struct linux_binprm * bprm,unsigned long pos,struct page * page) flush_arg_page() argument 245 valid_arg_len(struct linux_binprm * bprm,long len) valid_arg_len() argument 258 bprm_mm_init(struct linux_binprm * bprm) bprm_mm_init() argument 374 bprm_set_stack_limit(struct linux_binprm * bprm,unsigned long limit) bprm_set_stack_limit() argument 385 bprm_hit_stack_limit(struct linux_binprm * bprm) bprm_hit_stack_limit() argument 403 bprm_stack_limits(struct linux_binprm * bprm) bprm_stack_limits() argument 454 copy_strings(int argc,struct user_arg_ptr argv,struct linux_binprm * bprm) copy_strings() argument 546 copy_string_kernel(const char * arg,struct linux_binprm * bprm) copy_string_kernel() argument 584 copy_strings_kernel(int argc,const char * const * argv,struct linux_binprm * bprm) copy_strings_kernel() argument 603 setup_arg_pages(struct linux_binprm * bprm,unsigned long stack_top,int executable_stack) setup_arg_pages() argument 735 transfer_args_to_stack(struct linux_binprm * bprm,unsigned long * sp_location) transfer_args_to_stack() argument 843 exec_mmap(struct linux_binprm * bprm) exec_mmap() argument 1111 bprm_identity_file(const struct linux_binprm * bprm) bprm_identity_file() argument 1135 begin_new_exec(struct linux_binprm * bprm) begin_new_exec() argument 1358 would_dump(struct linux_binprm * bprm,struct file * file) would_dump() argument 1380 setup_new_exec(struct linux_binprm * bprm) setup_new_exec() argument 1406 finalize_exec(struct linux_binprm * bprm) finalize_exec() argument 1421 prepare_bprm_creds(struct linux_binprm * bprm) prepare_bprm_creds() argument 1455 bprm_open_interpreter(struct linux_binprm * bprm,const char * path) bprm_open_interpreter() argument 1471 bprm_drop_loader(struct linux_binprm * bprm) bprm_drop_loader() argument 1476 free_bprm(struct linux_binprm * bprm) free_bprm() argument 1511 struct linux_binprm *bprm; alloc_bprm() local 1583 bprm_change_interp(const char * interp,struct linux_binprm * bprm) bprm_change_interp() argument 1600 check_unsafe_exec(struct linux_binprm * bprm) check_unsafe_exec() argument 1642 bprm_fill_uid(struct linux_binprm * bprm,struct file * file) bprm_fill_uid() argument 1697 bprm_creds_from_file(struct linux_binprm * bprm) bprm_creds_from_file() argument 1712 prepare_binprm(struct linux_binprm * bprm) prepare_binprm() argument 1725 remove_arg_zero(struct linux_binprm * bprm) remove_arg_zero() argument 1759 search_binary_handler(struct linux_binprm * bprm) search_binary_handler() argument 1793 exec_binprm(struct linux_binprm * bprm) exec_binprm() argument 1842 bprm_execve(struct linux_binprm * bprm) bprm_execve() argument 1917 CLASS(bprm, bprm)(fd, filename, flags); do_execveat_common() local [all...] |
| H A D | binfmt_script.c | 34 static int load_script(struct linux_binprm *bprm) in load_script() argument 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() 61 i_end = next_non_spacetab(bprm->buf + 2, buf_end); in load_script() 77 i_name = next_non_spacetab(bprm->buf+2, i_end); in load_script() 93 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) 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() [all …]
|
| H A D | binfmt_misc.c | 144 const struct linux_binprm *bprm) in entry_matches_magic() argument 146 const char *s = bprm->buf + e->offset; in entry_matches_magic() 183 search_binfmt_handler(struct binfmt_misc *misc, struct linux_binprm *bprm) in search_binfmt_handler() argument 185 char *dot = strrchr(bprm->interp, '.'); in search_binfmt_handler() 202 if (!e->bpf_ops->match(bprm)) in search_binfmt_handler() 205 if (!entry_matches_magic(e, bprm)) in search_binfmt_handler() 232 struct linux_binprm *bprm) in get_binfmt_handler() argument 235 return search_binfmt_handler(misc, bprm); in get_binfmt_handler() 386 static void drop_staged_selection(struct linux_binprm *bprm) in DEFINE_FREE() 388 kfree(bprm->bpf_interp); in DEFINE_FREE() [all …]
|
| H A D | binfmt_misc_bpf.c | 106 static void bm_bpf_stage_selection(struct linux_binprm *bprm, char *path, in bm_bpf_stage_selection() argument 109 if (bprm->bpf_interp_file) in bm_bpf_stage_selection() 110 fput(bprm->bpf_interp_file); in bm_bpf_stage_selection() 111 kfree(bprm->bpf_interp); in bm_bpf_stage_selection() 112 bprm->bpf_interp = path; in bm_bpf_stage_selection() 113 bprm->bpf_interp_file = f; in bm_bpf_stage_selection() 133 __bpf_kfunc int bpf_binprm_set_interp(struct linux_binprm *bprm, in bpf_binprm_set_interp() argument 160 bm_bpf_stage_selection(bprm, interp, NULL); in bpf_binprm_set_interp() 182 __bpf_kfunc int bpf_binprm_select_interp(struct linux_binprm *bprm, in bpf_binprm_select_interp() argument 208 interp = binfmt_misc_find_interp(bprm->bpf_interps, buf); in bpf_binprm_select_interp() [all …]
|
| H A D | binfmt_flat.c | 108 static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start) in create_flat_tables() argument 117 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() 131 envp = (unsigned long)(sp + 2 + bprm->argc + 1); 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() 182 static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst, in decompress_exec() argument 203 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() 273 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() [all …]
|
| H A 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() 251 retval = kernel_read(bprm->file, interpreter_name, in load_elf_fdpic_binary() 266 interpreter = bprm_open_interpreter(bprm, in load_elf_fdpic_binary() 279 would_dump(bprm, interpreter); in load_elf_fdpic_binary() 282 retval = kernel_read(interpreter, bprm->buf, in load_elf_fdpic_binary() 290 interp_params.hdr = *((struct elfhdr *) bprm->buf); in load_elf_fdpic_binary() 304 bprm_drop_loader(bprm); in load_elf_fdpic_binary() [all …]
|
| /linux/security/apparmor/ |
| H A D | domain.c | 667 const struct linux_binprm *bprm, in profile_transition() argument 681 AA_BUG(!bprm); in profile_transition() 684 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_transition() 693 name = bprm->filename; in profile_transition() 698 new = find_attach(&bprm->file->f_path, profile->ns, in profile_transition() 728 new = x_to_label(profile, &bprm->file->f_path, name, in profile_transition() 800 bool stack, const struct linux_binprm *bprm, in profile_onexec() argument 812 AA_BUG(!bprm); in profile_onexec() 825 error = aa_path_name(&bprm->file->f_path, profile->path_flags, buffer, in profile_onexec() 833 xname = bprm->filename; in profile_onexec() [all …]
|
| /linux/security/tomoyo/ |
| H 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() 259 struct file *file = r->ee->bprm->file; in tomoyo_init_log() 262 bprm_info = tomoyo_print_bprm(r->ee->bprm, &r->ee->dump); in tomoyo_init_log() 279 struct linux_binprm *bprm = r->ee->bprm; in tomoyo_init_log() local 283 realpath, bprm->argc, bprm->envc, bprm_info); in tomoyo_init_log()
|
| H A D | domain.c | 617 struct linux_binprm *bprm = ee->bprm; in tomoyo_environ() local 622 unsigned long pos = bprm->p; in tomoyo_environ() 624 int argv_count = bprm->argc; in tomoyo_environ() 625 int envp_count = bprm->envc; in tomoyo_environ() 638 if (!tomoyo_dump_page(bprm, pos, &env_page)) in tomoyo_environ() 702 int tomoyo_find_next_domain(struct linux_binprm *bprm) in tomoyo_find_next_domain() argument 706 const char *original_name = bprm->filename; in tomoyo_find_next_domain() 723 ee->bprm = bprm; in tomoyo_find_next_domain() 725 ee->obj.path1 = bprm->file->f_path; in tomoyo_find_next_domain() 737 exename.name = tomoyo_realpath_from_path(&bprm->file->f_path); in tomoyo_find_next_domain() [all …]
|
| H 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() 130 if (!tomoyo_dump_page(bprm, pos, dump)) { in tomoyo_scan_bprm() 160 if (!tomoyo_argv(bprm->argc - argv_count, 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() 826 file = ee ? ee->bprm->file : NULL; in tomoyo_condition() [all …]
|
| H A D | tomoyo.c | 56 static void tomoyo_bprm_committed_creds(const struct linux_binprm *bprm) in tomoyo_bprm_committed_creds() argument 73 static int tomoyo_bprm_creds_for_exec(struct linux_binprm *bprm) in tomoyo_bprm_creds_for_exec() argument 80 tomoyo_load_policy(bprm->filename); in tomoyo_bprm_creds_for_exec() 92 static int tomoyo_bprm_check_security(struct linux_binprm *bprm) in tomoyo_bprm_check_security() argument 102 const int err = tomoyo_find_next_domain(bprm); in tomoyo_bprm_check_security() 111 &bprm->file->f_path, O_RDONLY); in tomoyo_bprm_check_security()
|
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | ima.c | 67 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 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()
|
| H A D | local_storage.c | 193 void BPF_PROG(exec, struct linux_binprm *bprm) in BPF_PROG() 205 storage->exec_inode = bprm->file->f_inode; 207 storage = bpf_inode_storage_get(&inode_storage_map, bprm->file->f_inode, 208 BPF_PROG(exec,struct linux_binprm * bprm) BPF_PROG() argument
|
| H A D | lsm.c | 112 int BPF_PROG(test_void_hook, struct linux_binprm *bprm) in BPF_PROG() 123 bpf_copy_from_user(args, sizeof(args), (void *)bprm->vma->vm_mm->arg_start); in BPF_PROG() 124 bpf_copy_from_user(args, sizeof(args), (void *)bprm->mm->arg_start); in BPF_PROG() 110 BPF_PROG(test_void_hook,struct linux_binprm * bprm) BPF_PROG() argument
|
| H A D | verifier_const.c | 92 int BPF_PROG(bprm, struct linux_binprm *bprm) in BPF_PROG() argument
|
| /linux/arch/riscv/kernel/ |
| H A D | vdso.c | 116 struct linux_binprm *bprm, in __setup_additional_pages() argument 158 int compat_arch_setup_additional_pages(struct linux_binprm *bprm, in compat_arch_setup_additional_pages() argument 167 ret = __setup_additional_pages(mm, bprm, uses_interp, in compat_arch_setup_additional_pages() 175 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument 183 ret = __setup_additional_pages(mm, bprm, uses_interp, &vdso_info); in arch_setup_additional_pages()
|
| /linux/security/ |
| H A D | commoncap.c | 627 struct linux_binprm *bprm, in bprm_caps_from_vfs_caps() argument 631 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps() 763 static int get_file_caps(struct linux_binprm *bprm, const struct file *file, in get_file_caps() argument 769 cap_clear(bprm->cred->cap_permitted); in get_file_caps() 790 bprm->filename); in get_file_caps() 796 rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap); in get_file_caps() 800 cap_clear(bprm->cred->cap_permitted); in get_file_caps() 818 * @bprm: The execution parameters, including the proposed creds 828 static void handle_privileged_root(struct linux_binprm *bprm, bool has_fcap, in handle_privileged_root() argument 832 struct cred *new = bprm in handle_privileged_root() 919 cap_bprm_creds_from_file(struct linux_binprm * bprm,const struct file * file) cap_bprm_creds_from_file() argument [all...] |
| /linux/security/ipe/ |
| H A D | hooks.c | 31 int ipe_bprm_check_security(struct linux_binprm *bprm) in ipe_bprm_check_security() argument 35 ipe_build_eval_ctx(&ctx, bprm->file, IPE_OP_EXEC, IPE_HOOK_BPRM_CHECK); in ipe_bprm_check_security() 54 int ipe_bprm_creds_for_exec(struct linux_binprm *bprm) in ipe_bprm_creds_for_exec() argument 58 if (!bprm->is_check) in ipe_bprm_creds_for_exec() 61 ipe_build_eval_ctx(&ctx, bprm->file, IPE_OP_EXEC, in ipe_bprm_creds_for_exec()
|
| H A D | hooks.h | 26 int ipe_bprm_check_security(struct linux_binprm *bprm); 28 int ipe_bprm_creds_for_exec(struct linux_binprm *bprm);
|
| /linux/fs/tests/ |
| H A D | exec_kunit.c | 5 struct linux_binprm bprm; member 111 struct linux_binprm bprm = result->bprm; in exec_test_bprm_stack_limits() local 114 rc = bprm_stack_limits(&bprm); in exec_test_bprm_stack_limits() 117 KUNIT_EXPECT_EQ_MSG(test, bprm.argmin, result->expected_argmin, "on loop %d", i); in exec_test_bprm_stack_limits()
|
| /linux/arch/arm64/kernel/ |
| H A D | vdso.c | 101 struct linux_binprm *bprm, in __setup_additional_pages() argument 294 int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in aarch32_setup_additional_pages() argument 307 ret = __setup_additional_pages(VDSO_ABI_AA32, mm, bprm, in aarch32_setup_additional_pages() 333 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument 341 ret = __setup_additional_pages(VDSO_ABI_AA64, mm, bprm, uses_interp); in arch_setup_additional_pages()
|
| /linux/arch/x86/include/asm/ |
| H A D | elf.h | 367 extern int arch_setup_additional_pages(struct linux_binprm *bprm, 369 extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm, 371 #define COMPAT_ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \ argument 372 compat_arch_setup_additional_pages(bprm, interpreter, \
|
| /linux/include/linux/ |
| H A D | elf.h | 31 #define ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \ argument 32 arch_setup_additional_pages(bprm, interpreter)
|
| /linux/arch/riscv/include/asm/ |
| H A D | elf.h | 125 extern int arch_setup_additional_pages(struct linux_binprm *bprm, 150 extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
|