/kernel/linux/linux-5.10/fs/ |
D | exec.c | 77 static int bprm_creds_from_file(struct linux_binprm *bprm); 188 static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) in acct_arg_size() argument 191 long diff = (long)(pages - bprm->vma_pages); in acct_arg_size() 196 bprm->vma_pages = pages; in acct_arg_size() 200 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, in get_arg_page() argument 209 ret = expand_downwards(bprm->vma, pos); in get_arg_page() 222 ret = get_user_pages_remote(bprm->mm, pos, 1, gup_flags, in get_arg_page() 228 acct_arg_size(bprm, vma_pages(bprm->vma)); in get_arg_page() 238 static void free_arg_pages(struct linux_binprm *bprm) in free_arg_pages() argument 242 static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, in flush_arg_page() argument [all …]
|
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 …]
|
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() 66 remove_arg_zero(bprm); in load_em86() 67 retval = copy_string_kernel(bprm->filename, bprm); in load_em86() 69 bprm->argc++; in load_em86() 71 retval = copy_string_kernel(i_arg, bprm); in load_em86() 73 bprm->argc++; in load_em86() 75 retval = copy_string_kernel(i_name, bprm); in load_em86() [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_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 if (put_user(bprm->argc, sp++)) in create_flat_tables() 146 envp = (unsigned long)(sp + 2 + bprm->argc + 1); in create_flat_tables() 152 for (i = bprm->argc; i > 0; i--) { in create_flat_tables() 165 for (i = bprm->envc; i > 0; i--) { in create_flat_tables() 197 static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst, in decompress_exec() argument 218 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() 288 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec() [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 144 fmt = check_file(bprm); in load_misc_binary() 153 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_misc_binary() 157 retval = remove_arg_zero(bprm); in load_misc_binary() 163 bprm->have_execfd = 1; in load_misc_binary() 166 retval = copy_string_kernel(bprm->interp, bprm); in load_misc_binary() 169 bprm->argc++; 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 = begin_new_exec(bprm); in load_elf_fdpic_binary() 355 setup_new_exec(bprm); in load_elf_fdpic_binary() [all …]
|
D | binfmt_elf.c | 68 static int load_elf_binary(struct linux_binprm *bprm); 172 create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, in create_elf_tables() argument 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() 269 NEW_AUX_ENT(AT_SECURE, bprm->secureexec); in create_elf_tables() 274 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_tables() 283 if (bprm->have_execfd) { in create_elf_tables() 284 NEW_AUX_ENT(AT_EXECFD, bprm->execfd); in create_elf_tables() 298 bprm->p = STACK_ROUND(sp, items); in create_elf_tables() [all …]
|
/kernel/linux/linux-5.10/arch/alpha/kernel/ |
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()
|
/kernel/linux/linux-5.10/arch/x86/ia32/ |
D | ia32_aout.c | 63 static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm) in create_aout_tables() argument 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() 154 retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT); in load_aout_binary() 169 error = read_code(bprm->file, text_addr, 32, in load_aout_binary() 188 bprm->file); in load_aout_binary() [all …]
|
/kernel/linux/linux-5.10/security/apparmor/ |
D | domain.c | 309 static int aa_xattrs_match(const struct linux_binprm *bprm, in aa_xattrs_match() argument 318 if (!bprm || !profile->xattr_count) in aa_xattrs_match() 324 d = bprm->file->f_path.dentry; in aa_xattrs_match() 386 static struct aa_label *find_attach(const struct linux_binprm *bprm, in find_attach() argument 429 if (bprm && profile->xattr_count) { in find_attach() 435 ret = aa_xattrs_match(bprm, profile, in find_attach() 556 const struct linux_binprm *bprm, in x_to_label() argument 584 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label() 588 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label() 623 const struct linux_binprm *bprm, in profile_transition() argument [all …]
|
/kernel/linux/linux-5.10/include/linux/ |
D | binfmts.h | 116 extern int begin_new_exec(struct linux_binprm * bprm); 117 extern void setup_new_exec(struct linux_binprm * bprm); 118 extern void finalize_exec(struct linux_binprm *bprm); 128 extern int setup_arg_pages(struct linux_binprm * bprm, 131 extern int transfer_args_to_stack(struct linux_binprm *bprm, 133 extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm); 134 int copy_string_kernel(const char *arg, struct linux_binprm *bprm);
|
D | audit.h | 394 extern void __audit_bprm(struct linux_binprm *bprm); 402 extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, 429 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument 432 __audit_bprm(bprm); in audit_bprm() 481 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument 486 return __audit_log_bprm_fcaps(bprm, new, old); in audit_log_bprm_fcaps() 615 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument 644 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
|
D | ima.h | 17 extern int ima_bprm_check(struct linux_binprm *bprm); 54 static inline int ima_bprm_check(struct linux_binprm *bprm) in ima_bprm_check() argument
|
D | security.h | 149 extern int cap_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file); 285 int security_bprm_creds_for_exec(struct linux_binprm *bprm); 286 int security_bprm_creds_from_file(struct linux_binprm *bprm, struct file *file); 287 int security_bprm_check(struct linux_binprm *bprm); 288 void security_bprm_committing_creds(struct linux_binprm *bprm); 289 void security_bprm_committed_creds(struct linux_binprm *bprm); 585 static inline int security_bprm_creds_for_exec(struct linux_binprm *bprm) in security_bprm_creds_for_exec() argument 590 static inline int security_bprm_creds_from_file(struct linux_binprm *bprm, in security_bprm_creds_from_file() argument 593 return cap_bprm_creds_from_file(bprm, file); in security_bprm_creds_from_file() 596 static inline int security_bprm_check(struct linux_binprm *bprm) in security_bprm_check() argument [all …]
|
/kernel/linux/linux-5.10/security/tomoyo/ |
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()
|
D | domain.c | 618 struct linux_binprm *bprm = ee->bprm; in tomoyo_environ() local 623 unsigned long pos = bprm->p; in tomoyo_environ() 625 int argv_count = bprm->argc; in tomoyo_environ() 626 int envp_count = bprm->envc; in tomoyo_environ() 639 if (!tomoyo_dump_page(bprm, pos, &env_page)) in tomoyo_environ() 703 int tomoyo_find_next_domain(struct linux_binprm *bprm) in tomoyo_find_next_domain() argument 707 const char *original_name = bprm->filename; in tomoyo_find_next_domain() 724 ee->bprm = bprm; in tomoyo_find_next_domain() 726 ee->obj.path1 = bprm->file->f_path; in tomoyo_find_next_domain() 898 bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos, in tomoyo_dump_page() argument [all …]
|
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 …]
|
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()
|
/kernel/linux/linux-5.10/security/ |
D | commoncap.c | 548 struct linux_binprm *bprm, in bprm_caps_from_vfs_caps() argument 552 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps() 669 static int get_file_caps(struct linux_binprm *bprm, struct file *file, in get_file_caps() argument 675 cap_clear(bprm->cred->cap_permitted); in get_file_caps() 695 bprm->filename); in get_file_caps() 701 rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap); in get_file_caps() 705 cap_clear(bprm->cred->cap_permitted); in get_file_caps() 733 static void handle_privileged_root(struct linux_binprm *bprm, bool has_fcap, in handle_privileged_root() argument 737 struct cred *new = bprm->cred; in handle_privileged_root() 747 warn_setuid_and_fcaps_mixed(bprm->filename); in handle_privileged_root() [all …]
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
D | lsm.c | 61 int BPF_PROG(test_void_hook, struct linux_binprm *bprm) in BPF_PROG() argument 71 bpf_copy_from_user(args, sizeof(args), (void *)bprm->vma->vm_mm->arg_start); in BPF_PROG() 72 bpf_copy_from_user(args, sizeof(args), (void *)bprm->mm->arg_start); in BPF_PROG()
|
/kernel/linux/linux-5.10/arch/arm64/kernel/ |
D | vdso.c | 235 struct linux_binprm *bprm, in __setup_additional_pages() argument 430 int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in aarch32_setup_additional_pages() argument 443 ret = __setup_additional_pages(VDSO_ABI_AA32, mm, bprm, in aarch32_setup_additional_pages() 488 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument 496 ret = __setup_additional_pages(VDSO_ABI_AA64, mm, bprm, uses_interp); in arch_setup_additional_pages()
|
/kernel/linux/linux-5.10/arch/arm64/include/asm/ |
D | elf.h | 186 extern int arch_setup_additional_pages(struct linux_binprm *bprm, 245 extern int aarch32_setup_additional_pages(struct linux_binprm *bprm,
|
/kernel/linux/linux-5.10/security/apparmor/include/ |
D | domain.h | 33 int apparmor_bprm_creds_for_exec(struct linux_binprm *bprm);
|
/kernel/linux/linux-5.10/arch/x86/entry/vdso/ |
D | vma.c | 406 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument 415 int compat_arch_setup_additional_pages(struct linux_binprm *bprm, in compat_arch_setup_additional_pages() argument 433 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument
|