Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/linux/linux_sysvec.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | linux_copyout_auxargs(struct image_params *imgp, uintptr_t base) | ||||
struct proc *p; | struct proc *p; | ||||
Elf32_Auxargs *args; | Elf32_Auxargs *args; | ||||
Elf32_Auxinfo *argarray, *pos; | Elf32_Auxinfo *argarray, *pos; | ||||
struct ps_strings *arginfo; | struct ps_strings *arginfo; | ||||
int error, issetugid; | int error, issetugid; | ||||
p = imgp->proc; | p = imgp->proc; | ||||
issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; | issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; | ||||
arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; | arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); | ||||
args = (Elf32_Auxargs *)imgp->auxargs; | args = (Elf32_Auxargs *)imgp->auxargs; | ||||
argarray = pos = malloc(LINUX_AT_COUNT * sizeof(*pos), M_TEMP, | argarray = pos = malloc(LINUX_AT_COUNT * sizeof(*pos), M_TEMP, | ||||
M_WAITOK | M_ZERO); | M_WAITOK | M_ZERO); | ||||
AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, linux_vdso_base); | AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, linux_vdso_base); | ||||
AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO, __kernel_vsyscall); | AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO, __kernel_vsyscall); | ||||
AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); | AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | linux_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) | ||||
char *stringp; | char *stringp; | ||||
uintptr_t destp, ustringp; | uintptr_t destp, ustringp; | ||||
struct ps_strings *arginfo; | struct ps_strings *arginfo; | ||||
char canary[LINUX_AT_RANDOM_LEN]; | char canary[LINUX_AT_RANDOM_LEN]; | ||||
size_t execpath_len; | size_t execpath_len; | ||||
struct proc *p; | struct proc *p; | ||||
p = imgp->proc; | p = imgp->proc; | ||||
arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; | arginfo = (struct ps_strings *)PROC_PS_STRINGS(p); | ||||
destp = (uintptr_t)arginfo; | destp = (uintptr_t)arginfo; | ||||
if (imgp->execpath != NULL && imgp->auxargs != NULL) { | if (imgp->execpath != NULL && imgp->auxargs != NULL) { | ||||
execpath_len = strlen(imgp->execpath) + 1; | execpath_len = strlen(imgp->execpath) + 1; | ||||
destp -= execpath_len; | destp -= execpath_len; | ||||
destp = rounddown2(destp, sizeof(void *)); | destp = rounddown2(destp, sizeof(void *)); | ||||
imgp->execpathp = (void *)destp; | imgp->execpathp = (void *)destp; | ||||
error = copyout(imgp->execpath, imgp->execpathp, execpath_len); | error = copyout(imgp->execpath, imgp->execpathp, execpath_len); | ||||
▲ Show 20 Lines • Show All 538 Lines • ▼ Show 20 Lines | struct sysentvec linux_sysvec = { | ||||
.sv_name = "Linux a.out", | .sv_name = "Linux a.out", | ||||
.sv_coredump = NULL, | .sv_coredump = NULL, | ||||
.sv_imgact_try = linux_exec_imgact_try, | .sv_imgact_try = linux_exec_imgact_try, | ||||
.sv_minsigstksz = LINUX_MINSIGSTKSZ, | .sv_minsigstksz = LINUX_MINSIGSTKSZ, | ||||
.sv_minuser = VM_MIN_ADDRESS, | .sv_minuser = VM_MIN_ADDRESS, | ||||
.sv_maxuser = VM_MAXUSER_ADDRESS, | .sv_maxuser = VM_MAXUSER_ADDRESS, | ||||
.sv_usrstack = LINUX_USRSTACK, | .sv_usrstack = LINUX_USRSTACK, | ||||
.sv_psstrings = PS_STRINGS, | .sv_psstrings = PS_STRINGS, | ||||
.sv_psstringssz = sizeof(struct ps_strings), | |||||
.sv_stackprot = VM_PROT_ALL, | .sv_stackprot = VM_PROT_ALL, | ||||
.sv_copyout_strings = exec_copyout_strings, | .sv_copyout_strings = exec_copyout_strings, | ||||
.sv_setregs = linux_exec_setregs, | .sv_setregs = linux_exec_setregs, | ||||
.sv_fixlimit = NULL, | .sv_fixlimit = NULL, | ||||
.sv_maxssiz = NULL, | .sv_maxssiz = NULL, | ||||
.sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32 | | .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32 | | ||||
SV_SIG_DISCIGN | SV_SIG_WAITNDQ, | SV_SIG_DISCIGN | SV_SIG_WAITNDQ, | ||||
.sv_set_syscall_retval = linux_set_syscall_retval, | .sv_set_syscall_retval = linux_set_syscall_retval, | ||||
Show All 24 Lines | struct sysentvec elf_linux_sysvec = { | ||||
.sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR, | .sv_elf_core_abi_vendor = FREEBSD_ABI_VENDOR, | ||||
.sv_elf_core_prepare_notes = elf32_prepare_notes, | .sv_elf_core_prepare_notes = elf32_prepare_notes, | ||||
.sv_imgact_try = linux_exec_imgact_try, | .sv_imgact_try = linux_exec_imgact_try, | ||||
.sv_minsigstksz = LINUX_MINSIGSTKSZ, | .sv_minsigstksz = LINUX_MINSIGSTKSZ, | ||||
.sv_minuser = VM_MIN_ADDRESS, | .sv_minuser = VM_MIN_ADDRESS, | ||||
.sv_maxuser = VM_MAXUSER_ADDRESS, | .sv_maxuser = VM_MAXUSER_ADDRESS, | ||||
.sv_usrstack = LINUX_USRSTACK, | .sv_usrstack = LINUX_USRSTACK, | ||||
.sv_psstrings = LINUX_PS_STRINGS, | .sv_psstrings = LINUX_PS_STRINGS, | ||||
.sv_psstringssz = sizeof(struct ps_strings), | |||||
.sv_stackprot = VM_PROT_ALL, | .sv_stackprot = VM_PROT_ALL, | ||||
.sv_copyout_auxargs = linux_copyout_auxargs, | .sv_copyout_auxargs = linux_copyout_auxargs, | ||||
.sv_copyout_strings = linux_copyout_strings, | .sv_copyout_strings = linux_copyout_strings, | ||||
.sv_setregs = linux_exec_setregs, | .sv_setregs = linux_exec_setregs, | ||||
.sv_fixlimit = NULL, | .sv_fixlimit = NULL, | ||||
.sv_maxssiz = NULL, | .sv_maxssiz = NULL, | ||||
.sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP | | .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP | | ||||
SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP, | SV_SIG_DISCIGN | SV_SIG_WAITNDQ | SV_TIMEKEEP, | ||||
▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines |