Lines Matching refs:args
127 struct uarg args; in exec_common() local
256 bzero(&args, sizeof (args)); in exec_common()
257 args.pathname = resolvepn.pn_path; in exec_common()
265 error = pfexec_call(p->p_cred, &resolvepn, &args.pfcred, in exec_common()
266 &args.scrubenv); in exec_common()
278 if (args.pfcred != NULL && in exec_common()
280 crfree(args.pfcred); in exec_common()
281 args.pfcred = NULL; in exec_common()
282 args.scrubenv = B_FALSE; in exec_common()
290 args.stk_prot = PROT_ZFOD; in exec_common()
291 args.dat_prot = PROT_ZFOD; in exec_common()
294 DTRACE_PROC1(exec, char *, args.pathname); in exec_common()
304 if ((error = gexec(&vp, &ua, &args, NULL, 0, &execsz, in exec_common()
425 setregs(&args); in exec_common()
541 struct uarg *args, in gexec() argument
575 if ((error = execpermissions(*vpp, &vattr, args)) != 0) in gexec()
599 args->pfcred == NULL ? cred : args->pfcred, args->pathname)) != 0) { in gexec()
603 if (args->pfcred != NULL) { in gexec()
605 newcred = cred = args->pfcred; in gexec()
654 } else if (level == 0 && args->pfcred != NULL) { in gexec()
655 newcred = cred = args->pfcred; in gexec()
724 args->stk_prot &= ~PROT_EXEC; in gexec()
726 args->execswp = eswp; /* Save execsw pointer in uarg for exec_func */ in gexec()
727 args->ex_vp = vp; in gexec()
757 error = (*eswp->exec_func)(vp, uap, args, idatap, level, execsz, in gexec()
859 args->traceinval = 1; in gexec()
863 if (args->traceinval) in gexec()
1102 execpermissions(struct vnode *vp, struct vattr *vattrp, struct uarg *args) in execpermissions() argument
1135 args->traceinval = 1; in execpermissions()
1410 struct uarg *args, in noexec() argument
1489 #define STK_AVAIL(args) ((char *)(args)->stk_offp - (args)->stk_strp) argument
1495 stk_add(uarg_t *args, const char *sp, enum uio_seg segflg) in stk_add() argument
1500 if (STK_AVAIL(args) < sizeof (int)) in stk_add()
1502 *--args->stk_offp = args->stk_strp - args->stk_base; in stk_add()
1505 error = copyinstr(sp, args->stk_strp, STK_AVAIL(args), &len); in stk_add()
1510 if (len > STK_AVAIL(args)) in stk_add()
1512 bcopy(sp, args->stk_strp, len); in stk_add()
1515 args->stk_strp += len; in stk_add()
1521 stk_getptr(uarg_t *args, char *src, char **dst) in stk_getptr() argument
1525 if (args->from_model == DATAMODEL_NATIVE) { in stk_getptr()
1538 stk_putptr(uarg_t *args, char *addr, char *value) in stk_putptr() argument
1540 if (args->to_model == DATAMODEL_NATIVE) in stk_putptr()
1547 stk_copyin(execa_t *uap, uarg_t *args, intpdata_t *intp, void **auxvpp) in stk_copyin() argument
1552 size_t ptrsize = args->from_ptrsize; in stk_copyin()
1561 if ((error = stk_add(args, intp->intp_name, UIO_SYSSPACE)) != 0) in stk_copyin()
1564 (error = stk_add(args, intp->intp_arg, UIO_SYSSPACE)) != 0) in stk_copyin()
1566 if (args->fname != NULL) in stk_copyin()
1567 error = stk_add(args, args->fname, UIO_SYSSPACE); in stk_copyin()
1569 error = stk_add(args, uap->fname, UIO_USERSPACE); in stk_copyin()
1576 if (stk_getptr(args, argv, &sp)) in stk_copyin()
1589 if (stk_getptr(args, argv, &sp)) in stk_copyin()
1593 if ((error = stk_add(args, sp, UIO_USERSPACE)) != 0) in stk_copyin()
1598 argc = (int *)(args->stk_base + args->stk_size) - args->stk_offp; in stk_copyin()
1599 args->arglen = args->stk_strp - args->stk_base; in stk_copyin()
1606 char *tmp = args->stk_strp; in stk_copyin()
1607 if (stk_getptr(args, envp, &sp)) in stk_copyin()
1611 if ((error = stk_add(args, sp, UIO_USERSPACE)) != 0) in stk_copyin()
1613 if (args->scrubenv && strncmp(tmp, "LD_", 3) == 0) { in stk_copyin()
1615 args->stk_strp = tmp; in stk_copyin()
1616 *(args->stk_offp++) = NULL; in stk_copyin()
1621 args->na = (int *)(args->stk_base + args->stk_size) - args->stk_offp; in stk_copyin()
1622 args->ne = args->na - argc; in stk_copyin()
1629 if ((error = stk_add(args, platform, UIO_SYSSPACE)) != 0) in stk_copyin()
1631 if ((error = stk_add(args, args->pathname, UIO_SYSSPACE)) != 0) in stk_copyin()
1633 if (args->brandname != NULL && in stk_copyin()
1634 (error = stk_add(args, args->brandname, UIO_SYSSPACE)) != 0) in stk_copyin()
1636 if (args->emulator != NULL && in stk_copyin()
1637 (error = stk_add(args, args->emulator, UIO_SYSSPACE)) != 0) in stk_copyin()
1650 size = (args->na + 4) * args->to_ptrsize + args->auxsize + in stk_copyin()
1651 (args->stk_strp - args->stk_base); in stk_copyin()
1656 pad = P2NPHASE(size, args->stk_align); in stk_copyin()
1658 if (STK_AVAIL(args) < pad) in stk_copyin()
1661 args->usrstack_size = size + pad; in stk_copyin()
1664 *args->stk_strp++ = 0; in stk_copyin()
1666 args->nc = args->stk_strp - args->stk_base; in stk_copyin()
1672 stk_copyout(uarg_t *args, char *usrstack, void **auxvpp, user_t *up) in stk_copyout() argument
1674 size_t ptrsize = args->to_ptrsize; in stk_copyout()
1676 char *kstrp = args->stk_base; in stk_copyout()
1677 char *ustrp = usrstack - args->nc - ptrsize; in stk_copyout()
1678 char *usp = usrstack - args->usrstack_size; in stk_copyout()
1679 int *offp = (int *)(args->stk_base + args->stk_size); in stk_copyout()
1680 int envc = args->ne; in stk_copyout()
1681 int argc = args->na - envc; in stk_copyout()
1693 if (stk_putptr(args, usp, (char *)(uintptr_t)argc)) in stk_copyout()
1705 if (stk_putptr(args, usp, &ustrp[*--offp])) in stk_copyout()
1711 pslen = MIN(args->arglen, PSARGSZ) - 1; in stk_copyout()
1727 if (stk_putptr(args, usp, &ustrp[*--offp])) in stk_copyout()
1734 args->stackend = usp += ptrsize; in stk_copyout()
1739 if (copyout(args->stk_base, ustrp, args->nc)) in stk_copyout()
1748 if (args->to_model == DATAMODEL_NATIVE) { in stk_copyout()
1752 if (args->brandname != NULL) in stk_copyout()
1755 if (args->emulator != NULL) in stk_copyout()
1764 if (args->brandname != NULL) in stk_copyout()
1767 if (args->emulator != NULL) in stk_copyout()
1824 exec_args(execa_t *uap, uarg_t *args, intpdata_t *intp, void **auxvpp) in exec_args() argument
1836 args->from_model = p->p_model; in exec_args()
1838 args->from_ptrsize = sizeof (long); in exec_args()
1840 args->from_ptrsize = sizeof (int32_t); in exec_args()
1843 if (args->to_model == DATAMODEL_NATIVE) { in exec_args()
1844 args->to_ptrsize = sizeof (long); in exec_args()
1845 args->ncargs = NCARGS; in exec_args()
1846 args->stk_align = STACK_ALIGN; in exec_args()
1847 if (args->addr32) in exec_args()
1852 args->to_ptrsize = sizeof (int32_t); in exec_args()
1853 args->ncargs = NCARGS32; in exec_args()
1854 args->stk_align = STACK_ALIGN32; in exec_args()
1858 ASSERT(P2PHASE((uintptr_t)usrstack, args->stk_align) == 0); in exec_args()
1869 args->stk_size = size; in exec_args()
1870 args->stk_base = kmem_alloc(size, KM_SLEEP); in exec_args()
1871 args->stk_strp = args->stk_base; in exec_args()
1872 args->stk_offp = (int *)(args->stk_base + size); in exec_args()
1873 error = stk_copyin(uap, args, intp, auxvpp); in exec_args()
1876 kmem_free(args->stk_base, size); in exec_args()
1879 if (size >= args->ncargs) in exec_args()
1883 size = args->usrstack_size; in exec_args()
1886 ASSERT(P2PHASE(size, args->stk_align) == 0); in exec_args()
1887 ASSERT((ssize_t)STK_AVAIL(args) >= 0); in exec_args()
1889 if (size > args->ncargs) { in exec_args()
1890 kmem_free(args->stk_base, args->stk_size); in exec_args()
1899 kmem_free(args->stk_base, args->stk_size); in exec_args()
1953 audit_exec(args->stk_base, args->stk_base + args->arglen, in exec_args()
1954 args->na - args->ne, args->ne, args->pfcred); in exec_args()
1976 up->u_execsw = args->execswp; in exec_args()
1983 p->p_model = args->to_model; in exec_args()
1985 p->p_stkprot = args->stk_prot; in exec_args()
1986 p->p_datprot = args->dat_prot; in exec_args()
2016 ASSERT(P2PHASE(sp_slew, args->stk_align) == 0); in exec_args()
2022 if (p->p_model == DATAMODEL_ILP32 || args->addr32) in exec_args()
2025 hat_join_srd(as->a_hat, args->ex_vp); in exec_args()
2030 error = stk_copyout(args, usrstack - sp_slew, auxvpp, up); in exec_args()
2031 kmem_free(args->stk_base, args->stk_size); in exec_args()