/freebsd/sys/powerpc/powerpc/ |
H A D | elf_common.c | 31 __elfN(powerpc_copyout_auxargs)(struct image_params *imgp, uintptr_t base) in __elfN() 52 if (imgp->proc->p_osrel >= P_OSREL_POWERPC_NEW_AUX_ARGS || in __elfN() 53 imgp->proc->p_osrel == 0) in __elfN() 54 return (__elfN(freebsd_copyout_auxargs)(imgp, base)); in __elfN() 56 args = (Elf_Auxargs *)imgp->auxargs; in __elfN() 60 vmspace = imgp->proc->p_vmspace; in __elfN() 72 if (imgp->execpathp != 0) in __elfN() 73 AUXARGS_ENTRY_PTR(pos, AT_OLD_EXECPATH, imgp->execpathp); in __elfN() 75 imgp->proc->p_ucred->cr_prison->pr_osreldate); in __elfN() 76 if (imgp->canary != 0) { in __elfN() [all …]
|
H A D | elf64_machdep.c | 61 static void exec_setregs_funcdesc(struct thread *td, struct image_params *imgp, 244 exec_setregs_funcdesc(struct thread *td, struct image_params *imgp, in exec_setregs_funcdesc() argument 251 exec_setregs(td, imgp, stack); in exec_setregs_funcdesc() 262 (void)copyin((void *)imgp->entry_addr, entry_desc, in exec_setregs_funcdesc() 264 tf->srr0 = entry_desc[0] + imgp->reloc_base; in exec_setregs_funcdesc() 265 tf->fixreg[2] = entry_desc[1] + imgp->reloc_base; in exec_setregs_funcdesc() 266 tf->fixreg[11] = entry_desc[2] + imgp->reloc_base; in exec_setregs_funcdesc()
|
/freebsd/sys/kern/ |
H A D | kern_exec.c | 376 execve_nosetid(struct image_params *imgp) in execve_nosetid() argument 378 imgp->credential_setid = false; in execve_nosetid() 379 if (imgp->newcred != NULL) { in execve_nosetid() 380 crfree(imgp->newcred); in execve_nosetid() 381 imgp->newcred = NULL; in execve_nosetid() 398 struct image_params image_params, *imgp; in do_execve() local 422 imgp = &image_params; in do_execve() 446 bzero(imgp, sizeof(*imgp)); in do_execve() 447 imgp->proc = p; in do_execve() 448 imgp->attr = &attr; in do_execve() [all …]
|
H A D | imgact_shell.c | 99 exec_shell_imgact(struct image_params *imgp) in exec_shell_imgact() argument 101 const char *image_header = imgp->image_header; in exec_shell_imgact() 116 if (imgp->interpreted & IMGACT_SHELL) in exec_shell_imgact() 119 imgp->interpreted |= IMGACT_SHELL; in exec_shell_imgact() 127 error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred); in exec_shell_imgact() 171 if (imgp->args->fname != NULL) { in exec_shell_imgact() 172 fname = imgp->args->fname; in exec_shell_imgact() 176 sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd); in exec_shell_imgact() 193 length = (imgp->args->argc == 0) ? 0 : in exec_shell_imgact() 194 strlen(imgp->args->begin_argv) + 1; /* bytes to delete */ in exec_shell_imgact() [all …]
|
H A D | imgact_aout.c | 64 static int exec_aout_imgact(struct image_params *imgp); 65 static int aout_fixup(uintptr_t *stack_base, struct image_params *imgp); 164 aout_fixup(uintptr_t *stack_base, struct image_params *imgp) in aout_fixup() argument 168 if (suword32((void *)*stack_base, imgp->args->argc) != 0) in aout_fixup() 174 exec_aout_imgact(struct image_params *imgp) in exec_aout_imgact() argument 186 a_out = (const struct exec *)imgp->image_header; in exec_aout_imgact() 219 imgp->ps_strings = (void *)aout_sysvec.sv_psstrings; in exec_aout_imgact() 255 if (a_out->a_data + a_out->a_text > imgp->attr->va_size) in exec_aout_imgact() 261 PROC_LOCK(imgp->proc); in exec_aout_imgact() 266 a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || in exec_aout_imgact() [all …]
|
H A D | imgact_elf.c | 87 static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, 91 static int __elfN(load_section)(const struct image_params *imgp, 94 static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); 98 static bool __elfN(check_note)(struct image_params *imgp, 337 __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, in __elfN() 340 const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; in __elfN() 367 ret = __elfN(check_note)(imgp, bi->brand_note, osrel, in __elfN() 371 ret = bi->header_supported(imgp, osrel, in __elfN() 412 bi->header_supported(imgp, NULL, NULL)) { in __elfN() 440 ret = bi->header_supported(imgp, NULL, NULL); in __elfN() [all …]
|
H A D | imgact_binmisc.c | 621 imgact_binmisc_exec(struct image_params *imgp) in imgact_binmisc_exec() argument 623 const char *image_header = imgp->image_header; in imgact_binmisc_exec() 644 if (imgp->interpreted & IMGACT_BINMISC) { in imgact_binmisc_exec() 649 imgp->interpreted |= IMGACT_BINMISC; in imgact_binmisc_exec() 656 if (imgp->args->fname != NULL) { in imgact_binmisc_exec() 657 fname = imgp->args->fname; in imgact_binmisc_exec() 661 sbuf_printf(sname, "/dev/fd/%d", imgp->args->fd); in imgact_binmisc_exec() 684 error = exec_args_adjust_args(imgp->args, 0, offset); in imgact_binmisc_exec() 690 imgp->args->argc += ibe->ibe_interp_argcnt; in imgact_binmisc_exec() 697 d = imgp->args->begin_argv; in imgact_binmisc_exec() [all …]
|
/freebsd/sys/compat/linux/ |
H A D | linux_elf.c | 327 __linuxN(copyout_strings)(struct image_params *imgp, uintptr_t *stack_base) in __linuxN() 339 p = imgp->proc; in __linuxN() 341 arginfo = imgp->ps_strings = (void *)destp; in __linuxN() 346 if (imgp->execpath != NULL && imgp->auxargs != NULL) { in __linuxN() 347 execpath_len = strlen(imgp->execpath) + 1; in __linuxN() 350 imgp->execpathp = (void *)destp; in __linuxN() 351 error = copyout(imgp->execpath, imgp->execpathp, execpath_len); in __linuxN() 361 imgp->canary = (void *)destp; in __linuxN() 362 error = copyout(canary, imgp->canary, sizeof(canary)); in __linuxN() 365 imgp->canarylen = sizeof(canary); in __linuxN() [all …]
|
H A D | linux_emul.c | 257 linux_on_exec(struct proc *p, struct image_params *imgp) in linux_on_exec() argument 267 MPASS((imgp->sysent->sv_flags & SV_ABI_MASK) == SV_ABI_LINUX); in linux_on_exec() 308 imgp->stack_prot & VM_PROT_EXECUTE) { in linux_on_exec()
|
H A D | linux_vdso.c | 156 vm_offset_t size, struct image_params *imgp) in linux_map_vdso() argument 162 MPASS((imgp->sysent->sv_flags & SV_ABI_MASK) == SV_ABI_LINUX); in linux_map_vdso()
|
/freebsd/sys/i386/linux/ |
H A D | imgact_linux.c | 58 exec_linux_imgact(struct image_params *imgp) in exec_linux_imgact() argument 60 const struct exec *a_out = (const struct exec *) imgp->image_header; in exec_linux_imgact() 101 if (a_out->a_data + a_out->a_text > imgp->attr->va_size) in exec_linux_imgact() 106 PROC_LOCK(imgp->proc); in exec_linux_imgact() 108 a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || in exec_linux_imgact() 109 racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { in exec_linux_imgact() 110 PROC_UNLOCK(imgp->proc); in exec_linux_imgact() 113 PROC_UNLOCK(imgp->proc); in exec_linux_imgact() 115 VOP_UNLOCK(imgp->vp); in exec_linux_imgact() 120 error = exec_new_vmspace(imgp, &linux_sysvec); in exec_linux_imgact() [all …]
|
H A D | linux_sysvec.c | 103 struct image_params *imgp, uintptr_t stack); 106 struct image_params *imgp); 121 linux_fixup(uintptr_t *stack_base, struct image_params *imgp) in linux_fixup() argument 127 envp = base + (imgp->args->argc + 1); in linux_fixup() 135 if (suword(base, imgp->args->argc) != 0) in linux_fixup() 142 linux32_arch_copyout_auxargs(struct image_params *imgp, Elf_Auxinfo **pos) in linux32_arch_copyout_auxargs() argument 565 linux_exec_setregs(struct thread *td, struct image_params *imgp, in linux_exec_setregs() argument 570 exec_setregs(td, imgp, stack); in linux_exec_setregs() 661 linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) in linux_on_exec_vmspace() argument 667 linux_vdso_base, LINUX_VDSOPAGE_SIZE, imgp); in linux_on_exec_vmspace() [all …]
|
/freebsd/sys/security/mac_veriexec/ |
H A D | veriexec_fingerprint.c | 105 identify_error (struct image_params *imgp, struct thread *td, const char *msg) in identify_error() argument 110 parent = imgp->proc->p_pptr; in identify_error() 117 (imgp->args != NULL) ? imgp->args->fname : "", in identify_error() 118 (uintmax_t)imgp->attr->va_fsid, (uintmax_t)imgp->attr->va_fileid, in identify_error() 119 imgp->attr->va_gen, td->td_ucred->cr_ruid, imgp->proc->p_pid, in identify_error() 259 mac_veriexec_fingerprint_check_image(struct image_params *imgp, in mac_veriexec_fingerprint_check_image() argument 262 struct vnode *vp = imgp->vp; in mac_veriexec_fingerprint_check_image() 269 error = mac_veriexec_metadata_fetch_fingerprint_status(vp, imgp->attr, in mac_veriexec_fingerprint_check_image() 280 identify_error(imgp, td, "got unexpected FINGERPRINT_INVALID"); in mac_veriexec_fingerprint_check_image() 298 if (!imgp->interpreted && in mac_veriexec_fingerprint_check_image() [all …]
|
/freebsd/sys/amd64/linux32/ |
H A D | linux32_sysvec.c | 102 static int linux_copyout_strings(struct image_params *imgp, 106 struct image_params *imgp, uintptr_t stack); 109 struct image_params *imgp); 135 linux32_arch_copyout_auxargs(struct image_params *imgp, Elf_Auxinfo **pos) in linux32_arch_copyout_auxargs() argument 570 linux_exec_setregs(struct thread *td, struct image_params *imgp, in linux_exec_setregs() argument 593 regs->tf_rip = imgp->entry_addr; in linux_exec_setregs() 603 regs->tf_rbx = (register_t)imgp->ps_strings; in linux_exec_setregs() 617 linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) in linux_copyout_strings() argument 627 arginfo = (struct linux32_ps_strings *)PROC_PS_STRINGS(imgp->proc); in linux_copyout_strings() 630 if (imgp->execpath != NULL && imgp->auxargs != NULL) { in linux_copyout_strings() [all …]
|
/freebsd/sys/arm64/arm64/ |
H A D | elf32_machdep.c | 75 static void freebsd32_setregs(struct thread *td, struct image_params *imgp, 170 elf32_arm_abi_supported(const struct image_params *imgp, in elf32_arm_abi_supported() argument 176 hdr = (const Elf32_Ehdr *)imgp->image_header; in elf32_arm_abi_supported() 182 imgp->args->fname); in elf32_arm_abi_supported() 273 freebsd32_setregs(struct thread *td, struct image_params *imgp, in freebsd32_setregs() argument 290 tf->tf_x[14] = imgp->entry_addr; in freebsd32_setregs() 291 tf->tf_elr = imgp->entry_addr; in freebsd32_setregs() 293 if ((uint32_t)imgp->entry_addr & 1) in freebsd32_setregs()
|
H A D | elf_machdep.c | 351 arm64_exec_protect(struct image_params *imgp, int flags __unused) in arm64_exec_protect() argument 363 hdr = (const Elf_Ehdr *)imgp->image_header; in arm64_exec_protect() 364 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in arm64_exec_protect() 368 if (phdr[i].p_type == PT_NOTE && __elfN(parse_notes)(imgp, in arm64_exec_protect() 382 sva = phdr[i].p_vaddr + imgp->et_dyn_addr; in arm64_exec_protect() 384 pmap_bti_set(vmspace_pmap(imgp->proc->p_vmspace), sva, eva); in arm64_exec_protect()
|
/freebsd/sys/security/mac/ |
H A D | mac_process.c | 134 mac_execve_enter(struct image_params *imgp, struct mac *mac_p) in mac_execve_enter() argument 169 imgp->execlabel = label; in mac_execve_enter() 174 mac_execve_exit(struct image_params *imgp) in mac_execve_exit() argument 176 if (imgp->execlabel != NULL) { in mac_execve_exit() 177 mac_cred_label_free(imgp->execlabel); in mac_execve_exit() 178 imgp->execlabel = NULL; in mac_execve_exit()
|
H A D | mac_vfs.c | 344 struct vnode *vp, struct label *interpvplabel, struct image_params *imgp) in mac_vnode_execve_transition() argument 350 vp->v_label, interpvplabel, imgp, imgp->execlabel); in mac_vnode_execve_transition() 355 struct label *interpvplabel, struct image_params *imgp) in mac_vnode_execve_will_transition() argument 364 vp->v_label, interpvplabel, imgp, imgp->execlabel); in mac_vnode_execve_will_transition() 476 struct image_params *imgp) in mac_vnode_check_exec() argument 482 MAC_POLICY_CHECK(vnode_check_exec, cred, vp, vp->v_label, imgp, in mac_vnode_check_exec() 483 imgp->execlabel); in mac_vnode_check_exec() 484 MAC_CHECK_PROBE3(vnode_check_exec, error, cred, vp, imgp); in mac_vnode_check_exec()
|
/freebsd/sys/arm64/linux/ |
H A D | linux_sysvec.c | 101 static void linux_exec_setregs(struct thread *td, struct image_params *imgp, 105 struct image_params *imgp); 153 linux64_arch_copyout_auxargs(struct image_params *imgp, Elf_Auxinfo **pos) in linux64_arch_copyout_auxargs() argument 157 AUXARGS_ENTRY((*pos), LINUX_AT_HWCAP, *imgp->sysent->sv_hwcap); in linux64_arch_copyout_auxargs() 158 AUXARGS_ENTRY((*pos), LINUX_AT_HWCAP2, *imgp->sysent->sv_hwcap2); in linux64_arch_copyout_auxargs() 166 linux_exec_setregs(struct thread *td, struct image_params *imgp, in linux_exec_setregs() argument 174 regs->tf_elr = imgp->entry_addr; in linux_exec_setregs() 468 linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) in linux_on_exec_vmspace() argument 473 LINUX_VDSOPAGE_SIZE, imgp); in linux_on_exec_vmspace() 475 error = linux_on_exec(p, imgp); in linux_on_exec_vmspace()
|
/freebsd/sys/dev/filemon/ |
H A D | filemon_wrapper.c | 118 struct image_params *imgp) in filemon_event_process_exec() argument 125 imgp->execpath != NULL ? imgp->execpath : "<unknown>"); in filemon_event_process_exec() 128 if (imgp->newcred != NULL && in filemon_event_process_exec() 129 imgp->credential_setid && in filemon_event_process_exec()
|
/freebsd/sys/security/mac_grantbylabel/ |
H A D | mac_grantbylabel.c | 447 struct image_params *imgp, struct label *execlabel __unused) in mac_grantbylabel_vnode_check_exec() argument 474 struct label *interpvplabel, struct image_params *imgp, in mac_grantbylabel_vnode_execve_will_transition() argument 479 if (imgp->interpreted) { in mac_grantbylabel_vnode_execve_will_transition() 482 SLOT_SET(imgp->proc->p_label, gbl); in mac_grantbylabel_vnode_execve_will_transition()
|
/freebsd/sys/arm/arm/ |
H A D | elf_machdep.c | 124 elf32_arm_abi_supported(const struct image_params *imgp, in elf32_arm_abi_supported() argument 127 const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; in elf32_arm_abi_supported() 135 EF_ARM_EABI_VERSION(hdr->e_flags), imgp->args->fname); in elf32_arm_abi_supported()
|
H A D | exec_machdep.c | 77 exec_setregs(struct thread *td, struct image_params *imgp, uintptr_t stack) in exec_setregs() argument 83 tf->tf_usr_lr = imgp->entry_addr; in exec_setregs() 85 tf->tf_pc = imgp->entry_addr; in exec_setregs() 87 if ((register_t)imgp->entry_addr & 1) in exec_setregs()
|
/freebsd/sys/amd64/linux/ |
H A D | linux_sysvec.c | 108 static void linux_exec_setregs(struct thread *td, struct image_params *imgp, 112 struct image_params *imgp); 222 linux64_arch_copyout_auxargs(struct image_params *imgp, Elf_Auxinfo **pos) in linux64_arch_copyout_auxargs() argument 235 linux_exec_setregs(struct thread *td, struct image_params *imgp, in linux_exec_setregs() argument 256 regs->tf_rip = imgp->entry_addr; in linux_exec_setregs() 722 linux_on_exec_vmspace(struct proc *p, struct image_params *imgp) in linux_on_exec_vmspace() argument 727 LINUX_VDSOPAGE_SIZE, imgp); in linux_on_exec_vmspace() 729 error = linux_on_exec(p, imgp); in linux_on_exec_vmspace()
|
/freebsd/sys/compat/freebsd32/ |
H A D | freebsd32_misc.c | 3596 freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) in freebsd32_copyout_strings() 3609 sysent = imgp->sysent; in freebsd32_copyout_strings() 3611 arginfo = (struct freebsd32_ps_strings *)PROC_PS_STRINGS(imgp->proc); in freebsd32_copyout_strings() 3612 imgp->ps_strings = arginfo; in freebsd32_copyout_strings() 3618 if (!PROC_HAS_SHP(imgp->proc)) { in freebsd32_copyout_strings() 3631 if (imgp->execpath != NULL && imgp->auxargs != NULL) { in freebsd32_copyout_strings() 3632 execpath_len = strlen(imgp->execpath) + 1; in freebsd32_copyout_strings() 3634 imgp->execpathp = (void *)destp; in freebsd32_copyout_strings() 3635 error = copyout(imgp in freebsd32_copyout_strings() 3595 freebsd32_copyout_strings(struct image_params * imgp,uintptr_t * stack_base) freebsd32_copyout_strings() argument [all...] |