Home
last modified time | relevance | path

Searched refs:bprm (Results 1 – 25 of 56) sorted by relevance

123

/linux/fs/
H A Dbinfmt_script.c34 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 Dbinfmt_flat.c108 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 Dbinfmt_misc.c91 struct linux_binprm *bprm) in search_binfmt_handler() argument
93 char *p = strrchr(bprm->interp, '.'); in search_binfmt_handler()
113 s = bprm->buf + e->offset; in search_binfmt_handler()
141 struct linux_binprm *bprm) in get_binfmt_handler() argument
146 e = search_binfmt_handler(misc, bprm); in get_binfmt_handler()
202 static int load_misc_binary(struct linux_binprm *bprm) in load_misc_binary() argument
213 fmt = get_binfmt_handler(misc, bprm); in load_misc_binary()
219 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_misc_binary()
223 bprm->interp_flags |= BINPRM_FLAGS_PRESERVE_ARGV0; in load_misc_binary()
225 retval = remove_arg_zero(bprm); in load_misc_binary()
[all …]
H A Dbinfmt_elf_fdpic.c182 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()
354 setup_new_exec(bprm); in load_elf_fdpic_binary()
[all …]
H A Dbinfmt_elf.c69 static int load_elf_binary(struct linux_binprm *bprm);
156 create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, in create_elf_tables() argument
161 unsigned long p = bprm->p; in create_elf_tables()
162 int argc = bprm->argc; in create_elf_tables()
163 int envc = bprm->envc; in create_elf_tables()
248 if (bprm->interp_flags & BINPRM_FLAGS_PRESERVE_ARGV0) in create_elf_tables()
256 NEW_AUX_ENT(AT_SECURE, bprm->secureexec); in create_elf_tables()
267 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_tables()
276 if (bprm->have_execfd) { in create_elf_tables()
277 NEW_AUX_ENT(AT_EXECFD, bprm->execfd); in create_elf_tables()
[all …]
/linux/include/linux/
H A Dbinfmts.h126 extern int begin_new_exec(struct linux_binprm * bprm);
127 extern void setup_new_exec(struct linux_binprm * bprm);
128 extern void finalize_exec(struct linux_binprm *bprm);
138 extern int setup_arg_pages(struct linux_binprm * bprm,
141 extern int transfer_args_to_stack(struct linux_binprm *bprm,
143 extern int bprm_change_interp(const char *interp, struct linux_binprm *bprm);
144 int copy_string_kernel(const char *arg, struct linux_binprm *bprm);
H A Daudit.h406 extern void __audit_bprm(struct linux_binprm *bprm);
414 extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
442 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument
445 __audit_bprm(bprm); in audit_bprm()
494 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
499 return __audit_log_bprm_fcaps(bprm, new, old); in audit_log_bprm_fcaps()
636 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument
665 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
H A Delf.h31 #define ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \ argument
32 arch_setup_additional_pages(bprm, interpreter)
/linux/security/tomoyo/
H A Daudit.c22 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()
H A Ddomain.c616 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()
701 int tomoyo_find_next_domain(struct linux_binprm *bprm) in tomoyo_find_next_domain() argument
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()
736 exename.name = tomoyo_realpath_from_path(&bprm->file->f_path); in tomoyo_find_next_domain()
[all …]
H A Dcondition.c109 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 Dtomoyo.c56 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 Dima.c67 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 Dbprm_opts.c22 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 Dlocal_storage.c208 void BPF_PROG(exec, struct linux_binprm *bprm) in BPF_PROG() argument
220 storage->exec_inode = bprm->file->f_inode; in BPF_PROG()
222 storage = bpf_inode_storage_get(&inode_storage_map, bprm->file->f_inode, in BPF_PROG()
H A Dlsm.c110 int BPF_PROG(test_void_hook, struct linux_binprm *bprm) in BPF_PROG() argument
121 bpf_copy_from_user(args, sizeof(args), (void *)bprm->vma->vm_mm->arg_start); in BPF_PROG()
122 bpf_copy_from_user(args, sizeof(args), (void *)bprm->mm->arg_start); in BPF_PROG()
H A Dverifier_const.c92 int BPF_PROG(bprm, struct linux_binprm *bprm) in BPF_PROG() argument
/linux/security/
H A Dcommoncap.c616 struct linux_binprm *bprm, in bprm_caps_from_vfs_caps() argument
620 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
752 static int get_file_caps(struct linux_binprm *bprm, const struct file *file, in get_file_caps() argument
758 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
779 bprm->filename); in get_file_caps()
785 rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap); in get_file_caps()
789 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
817 static void handle_privileged_root(struct linux_binprm *bprm, bool has_fcap, in handle_privileged_root() argument
821 struct cred *new = bprm->cred; in handle_privileged_root()
831 warn_setuid_and_fcaps_mixed(bprm->filename); in handle_privileged_root()
[all …]
/linux/fs/tests/
H A Dexec_kunit.c5 struct linux_binprm bprm; member
120 struct linux_binprm bprm = result->bprm; in exec_test_bprm_stack_limits() local
123 rc = bprm_stack_limits(&bprm); in exec_test_bprm_stack_limits()
126 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 Dvdso.c181 struct linux_binprm *bprm, in __setup_additional_pages() argument
373 int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in aarch32_setup_additional_pages() argument
386 ret = __setup_additional_pages(VDSO_ABI_AA32, mm, bprm, in aarch32_setup_additional_pages()
412 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument
420 ret = __setup_additional_pages(VDSO_ABI_AA64, mm, bprm, uses_interp); in arch_setup_additional_pages()
/linux/arch/x86/include/asm/
H A Delf.h372 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
374 extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
376 #define COMPAT_ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \ argument
377 compat_arch_setup_additional_pages(bprm, interpreter, \
/linux/arch/riscv/include/asm/
H A Delf.h125 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
150 extern int compat_arch_setup_additional_pages(struct linux_binprm *bprm,
/linux/include/trace/events/
H A Dsched.h403 struct linux_binprm *bprm),
405 TP_ARGS(p, old_pid, bprm),
408 __string( filename, bprm->filename )
436 TP_PROTO(struct task_struct *task, struct linux_binprm *bprm),
438 TP_ARGS(task, bprm),
441 __string( interp, bprm->interp )
442 __string( filename, bprm->filename )
/linux/security/integrity/ima/
H A Dima_main.c544 static int ima_bprm_check(struct linux_binprm *bprm) in ima_bprm_check() argument
550 ret = process_measurement(bprm->file, current_cred(), in ima_bprm_check()
555 security_cred_getlsmprop(bprm->cred, &prop); in ima_bprm_check()
556 return process_measurement(bprm->file, bprm->cred, &prop, NULL, 0, in ima_bprm_check()
573 static int ima_bprm_creds_for_exec(struct linux_binprm *bprm) in ima_bprm_creds_for_exec() argument
582 if (!bprm->is_check) in ima_bprm_creds_for_exec()
585 return ima_bprm_check(bprm); in ima_bprm_creds_for_exec()
/linux/arch/arm64/include/asm/
H A Delf.h186 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
243 extern int aarch32_setup_additional_pages(struct linux_binprm *bprm,

123