Home
last modified time | relevance | path

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

123

/Linux-v4.19/fs/
Dexec.c182 static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) in acct_arg_size() argument
185 long diff = (long)(pages - bprm->vma_pages); in acct_arg_size()
190 bprm->vma_pages = pages; in acct_arg_size()
194 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, in get_arg_page() argument
203 ret = expand_downwards(bprm->vma, pos); in get_arg_page()
216 ret = get_user_pages_remote(current, bprm->mm, pos, 1, gup_flags, in get_arg_page()
222 unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; in get_arg_page()
237 ptr_size = (bprm->argc + bprm->envc) * sizeof(void *); in get_arg_page()
242 acct_arg_size(bprm, size / PAGE_SIZE); in get_arg_page()
260 limit = min(limit, bprm->rlim_stack.rlim_cur / 4); in get_arg_page()
[all …]
Dbinfmt_script.c17 static int load_script(struct linux_binprm *bprm) in load_script() argument
24 if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) in load_script()
33 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_script()
41 allow_write_access(bprm->file); in load_script()
42 fput(bprm->file); in load_script()
43 bprm->file = NULL; in load_script()
45 bprm->buf[BINPRM_BUF_SIZE - 1] = '\0'; in load_script()
46 if ((cp = strchr(bprm->buf, '\n')) == NULL) in load_script()
47 cp = bprm->buf+BINPRM_BUF_SIZE-1; in load_script()
49 while (cp > bprm->buf) { in load_script()
[all …]
Dbinfmt_em86.c25 static int load_em86(struct linux_binprm *bprm) in load_em86() argument
34 elf_ex = *((struct elfhdr *)bprm->buf); in load_em86()
42 !bprm->file->f_op->mmap) { in load_em86()
47 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_em86()
50 allow_write_access(bprm->file); in load_em86()
51 fput(bprm->file); in load_em86()
52 bprm->file = NULL; in load_em86()
69 remove_arg_zero(bprm); in load_em86()
70 retval = copy_strings_kernel(1, &bprm->filename, bprm); in load_em86()
72 bprm->argc++; in load_em86()
[all …]
Dbinfmt_flat.c112 static int create_flat_tables(struct linux_binprm *bprm, unsigned long arg_start) in create_flat_tables() argument
121 sp -= bprm->envc + 1; in create_flat_tables()
122 sp -= bprm->argc + 1; in create_flat_tables()
129 __put_user(bprm->argc, sp++); in create_flat_tables()
133 envp = (unsigned long)(sp + 2 + bprm->argc + 1); in create_flat_tables()
139 for (i = bprm->argc; i > 0; i--) { in create_flat_tables()
150 for (i = bprm->envc; i > 0; i--) { in create_flat_tables()
180 static int decompress_exec(struct linux_binprm *bprm, loff_t fpos, char *dst, in decompress_exec() argument
201 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec()
271 ret = kernel_read(bprm->file, buf, LBUFSIZE, &fpos); in decompress_exec()
[all …]
Dbinfmt_aout.c141 static unsigned long __user *create_aout_tables(char __user *p, struct linux_binprm * bprm) in create_aout_tables() argument
146 int argc = bprm->argc; in create_aout_tables()
147 int envc = bprm->envc; in create_aout_tables()
154 if (bprm->loader) { in create_aout_tables()
157 put_user(bprm->loader, --sp); in create_aout_tables()
160 put_user(bprm->exec, --sp); in create_aout_tables()
199 static int load_aout_binary(struct linux_binprm * bprm) in load_aout_binary() argument
208 ex = *((struct exec *) bprm->buf); /* exec-header */ in load_aout_binary()
212 i_size_read(file_inode(bprm->file)) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { in load_aout_binary()
220 if (!bprm->file->f_op->mmap) in load_aout_binary()
[all …]
Dbinfmt_misc.c88 static Node *check_file(struct linux_binprm *bprm) in check_file() argument
90 char *p = strrchr(bprm->interp, '.'); in check_file()
111 s = bprm->buf + e->offset; in check_file()
130 static int load_misc_binary(struct linux_binprm *bprm) in load_misc_binary() argument
143 fmt = check_file(bprm); in load_misc_binary()
152 if (bprm->interp_flags & BINPRM_FLAGS_PATH_INACCESSIBLE) in load_misc_binary()
156 retval = remove_arg_zero(bprm); in load_misc_binary()
172 fd_install(fd_binary, bprm->file); in load_misc_binary()
176 would_dump(bprm, bprm->file); in load_misc_binary()
178 allow_write_access(bprm->file); in load_misc_binary()
[all …]
Dbinfmt_elf_fdpic.c186 static int load_elf_fdpic_binary(struct linux_binprm *bprm) in load_elf_fdpic_binary() argument
209 exec_params.hdr = *(struct elfhdr *) bprm->buf; in load_elf_fdpic_binary()
214 if (!is_elf(&exec_params.hdr, bprm->file)) in load_elf_fdpic_binary()
228 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()
278 would_dump(bprm, interpreter); in load_elf_fdpic_binary()
281 retval = kernel_read(interpreter, bprm->buf, in load_elf_fdpic_binary()
289 interp_params.hdr = *((struct elfhdr *) bprm->buf); in load_elf_fdpic_binary()
345 retval = flush_old_exec(bprm); in load_elf_fdpic_binary()
359 setup_new_exec(bprm); in load_elf_fdpic_binary()
[all …]
Dbinfmt_elf.c59 static int load_elf_binary(struct linux_binprm *bprm);
165 create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec, in create_elf_tables() argument
168 unsigned long p = bprm->p; in create_elf_tables()
169 int argc = bprm->argc; in create_elf_tables()
170 int envc = bprm->envc; in create_elf_tables()
260 NEW_AUX_ENT(AT_SECURE, bprm->secureexec); in create_elf_tables()
265 NEW_AUX_ENT(AT_EXECFN, bprm->exec); in create_elf_tables()
274 if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) { in create_elf_tables()
275 NEW_AUX_ENT(AT_EXECFD, bprm->interp_data); in create_elf_tables()
288 bprm->p = STACK_ROUND(sp, items); in create_elf_tables()
[all …]
/Linux-v4.19/arch/alpha/kernel/
Dbinfmt_loader.c9 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 allow_write_access(bprm->file); in load_binary()
23 fput(bprm->file); in load_binary()
24 bprm->file = NULL; in load_binary()
26 loader = bprm->vma->vm_end - sizeof(void *); in load_binary()
34 bprm->taso = eh->ah.entry < 0x100000000UL; in load_binary()
36 bprm->file = file; in load_binary()
37 bprm->loader = loader; in load_binary()
[all …]
/Linux-v4.19/include/linux/
Dbinfmts.h121 extern int flush_old_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);
140 struct linux_binprm *bprm);
141 extern int prepare_bprm_creds(struct linux_binprm *bprm);
142 extern void install_exec_creds(struct linux_binprm *bprm);
Daudit.h344 extern void __audit_bprm(struct linux_binprm *bprm);
352 extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
375 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument
378 __audit_bprm(bprm); in audit_bprm()
427 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
432 return __audit_log_bprm_fcaps(bprm, new, old); in audit_log_bprm_fcaps()
539 static inline void audit_bprm(struct linux_binprm *bprm) in audit_bprm() argument
568 static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, in audit_log_bprm_fcaps() argument
Dima.h19 extern int ima_bprm_check(struct linux_binprm *bprm);
34 static inline int ima_bprm_check(struct linux_binprm *bprm) in ima_bprm_check() argument
Dsecurity.h84 extern int cap_bprm_set_creds(struct linux_binprm *bprm);
245 int security_bprm_set_creds(struct linux_binprm *bprm);
246 int security_bprm_check(struct linux_binprm *bprm);
247 void security_bprm_committing_creds(struct linux_binprm *bprm);
248 void security_bprm_committed_creds(struct linux_binprm *bprm);
532 static inline int security_bprm_set_creds(struct linux_binprm *bprm) in security_bprm_set_creds() argument
534 return cap_bprm_set_creds(bprm); in security_bprm_set_creds()
537 static inline int security_bprm_check(struct linux_binprm *bprm) in security_bprm_check() argument
542 static inline void security_bprm_committing_creds(struct linux_binprm *bprm) in security_bprm_committing_creds() argument
546 static inline void security_bprm_committed_creds(struct linux_binprm *bprm) in security_bprm_committed_creds() argument
/Linux-v4.19/security/apparmor/
Ddomain.c313 static int aa_xattrs_match(const struct linux_binprm *bprm, in aa_xattrs_match() argument
322 if (!bprm || !profile->xattr_count) in aa_xattrs_match()
328 d = bprm->file->f_path.dentry; in aa_xattrs_match()
383 static struct aa_profile *__attach_match(const struct linux_binprm *bprm, in __attach_match() argument
425 ret = aa_xattrs_match(bprm, profile, state); in __attach_match()
478 static struct aa_label *find_attach(const struct linux_binprm *bprm, in find_attach() argument
485 profile = aa_get_profile(__attach_match(bprm, name, list, info)); in find_attach()
551 const struct linux_binprm *bprm, in x_to_label() argument
579 new = find_attach(bprm, ns, &profile->base.profiles, in x_to_label()
583 new = find_attach(bprm, ns, &ns->base.profiles, in x_to_label()
[all …]
/Linux-v4.19/arch/x86/ia32/
Dia32_aout.c220 static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm) in create_aout_tables() argument
223 int argc = bprm->argc, envc = bprm->envc; in create_aout_tables()
261 static int load_aout_binary(struct linux_binprm *bprm) in load_aout_binary() argument
268 ex = *((struct exec *) bprm->buf); /* exec-header */ in load_aout_binary()
272 i_size_read(file_inode(bprm->file)) < in load_aout_binary()
290 retval = flush_old_exec(bprm); in load_aout_binary()
298 setup_new_exec(bprm); in load_aout_binary()
311 retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT); in load_aout_binary()
315 install_exec_creds(bprm); in load_aout_binary()
328 error = read_code(bprm->file, text_addr, 32, in load_aout_binary()
[all …]
/Linux-v4.19/security/
Dcommoncap.c536 struct linux_binprm *bprm, in bprm_caps_from_vfs_caps() argument
540 struct cred *new = bprm->cred; in bprm_caps_from_vfs_caps()
655 static int get_file_caps(struct linux_binprm *bprm, bool *effective, bool *has_fcap) in get_file_caps() argument
660 cap_clear(bprm->cred->cap_permitted); in get_file_caps()
665 if (!mnt_may_suid(bprm->file->f_path.mnt)) in get_file_caps()
673 if (!current_in_userns(bprm->file->f_path.mnt->mnt_sb->s_user_ns)) in get_file_caps()
676 rc = get_vfs_caps_from_disk(bprm->file->f_path.dentry, &vcaps); in get_file_caps()
680 bprm->filename); in get_file_caps()
686 rc = bprm_caps_from_vfs_caps(&vcaps, bprm, effective, has_fcap); in get_file_caps()
689 __func__, rc, bprm->filename); in get_file_caps()
[all …]
/Linux-v4.19/security/tomoyo/
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()
45 if (!tomoyo_dump_page(bprm, pos, dump)) in tomoyo_print_bprm()
258 struct file *file = r->ee->bprm->file; in tomoyo_init_log()
260 bprm_info = tomoyo_print_bprm(r->ee->bprm, &r->ee->dump); in tomoyo_init_log()
277 struct linux_binprm *bprm = r->ee->bprm; in tomoyo_init_log() local
280 realpath, bprm->argc, bprm->envc, bprm_info); in tomoyo_init_log()
Dtomoyo.c74 static int tomoyo_bprm_set_creds(struct linux_binprm *bprm) in tomoyo_bprm_set_creds() argument
80 if (bprm->called_set_creds) in tomoyo_bprm_set_creds()
88 tomoyo_load_policy(bprm->filename); in tomoyo_bprm_set_creds()
97 bprm->cred->security)->users); in tomoyo_bprm_set_creds()
102 bprm->cred->security = NULL; in tomoyo_bprm_set_creds()
113 static int tomoyo_bprm_check_security(struct linux_binprm *bprm) in tomoyo_bprm_check_security() argument
115 struct tomoyo_domain_info *domain = bprm->cred->security; in tomoyo_bprm_check_security()
123 const int err = tomoyo_find_next_domain(bprm); in tomoyo_bprm_check_security()
130 return tomoyo_check_open_permission(domain, &bprm->file->f_path, in tomoyo_bprm_check_security()
Ddomain.c594 struct linux_binprm *bprm = ee->bprm; in tomoyo_environ() local
599 unsigned long pos = bprm->p; in tomoyo_environ()
601 int argv_count = bprm->argc; in tomoyo_environ()
602 int envp_count = bprm->envc; in tomoyo_environ()
615 if (!tomoyo_dump_page(bprm, pos, &env_page)) in tomoyo_environ()
679 int tomoyo_find_next_domain(struct linux_binprm *bprm) in tomoyo_find_next_domain() argument
683 const char *original_name = bprm->filename; in tomoyo_find_next_domain()
700 ee->bprm = bprm; in tomoyo_find_next_domain()
702 ee->obj.path1 = bprm->file->f_path; in tomoyo_find_next_domain()
846 bprm->cred->security = domain; in tomoyo_find_next_domain()
[all …]
Dcondition.c105 struct linux_binprm *bprm = ee->bprm; in tomoyo_scan_bprm() local
109 unsigned long pos = bprm->p; in tomoyo_scan_bprm()
111 int argv_count = bprm->argc; in tomoyo_scan_bprm()
112 int envp_count = bprm->envc; in tomoyo_scan_bprm()
125 if (!tomoyo_dump_page(bprm, pos, dump)) { in tomoyo_scan_bprm()
154 if (!tomoyo_argv(bprm->argc - argv_count, in tomoyo_scan_bprm()
760 struct linux_binprm *bprm = NULL; in tomoyo_condition() local
768 bprm = r->ee->bprm; in tomoyo_condition()
769 if (!bprm && (argc || envc)) in tomoyo_condition()
803 file = ee ? ee->bprm->file : NULL; in tomoyo_condition()
[all …]
/Linux-v4.19/kernel/trace/
Dtrace_probe.c172 struct bitfield_fetch_param *bprm = data; \
174 call_fetch(&bprm->orig, regs, &buf); \
176 buf <<= bprm->hi_shift; \
177 buf >>= bprm->low_shift; \
490 struct bitfield_fetch_param *bprm; in __parse_bitfield_probe_arg() local
497 bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); in __parse_bitfield_probe_arg()
498 if (!bprm) in __parse_bitfield_probe_arg()
501 bprm->orig = *f; in __parse_bitfield_probe_arg()
503 f->data = (void *)bprm; in __parse_bitfield_probe_arg()
515 bprm->hi_shift = BYTES_TO_BITS(t->size) - (bw + bo); in __parse_bitfield_probe_arg()
[all …]
/Linux-v4.19/security/integrity/ima/
Dima_main.c360 int ima_bprm_check(struct linux_binprm *bprm) in ima_bprm_check() argument
366 ret = process_measurement(bprm->file, current_cred(), secid, NULL, 0, in ima_bprm_check()
371 security_cred_getsecid(bprm->cred, &secid); in ima_bprm_check()
372 return process_measurement(bprm->file, bprm->cred, secid, NULL, 0, in ima_bprm_check()
/Linux-v4.19/arch/arm64/include/asm/
Delf.h168 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
213 extern int aarch32_setup_vectors_page(struct linux_binprm *bprm,
/Linux-v4.19/arch/x86/entry/vdso/
Dvma.c295 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument
304 int compat_arch_setup_additional_pages(struct linux_binprm *bprm, in compat_arch_setup_additional_pages() argument
322 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) in arch_setup_additional_pages() argument
/Linux-v4.19/security/apparmor/include/
Ddomain.h37 int apparmor_bprm_set_creds(struct linux_binprm *bprm);

123