summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-08-22 22:04:43 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-08-22 22:04:43 +0000
commit83a2180cac5e768b5b7a584762161b491dc960a2 (patch)
tree996acdd276b22aae0b284ba43d2fa8cb293cb8a2 /sys/compat
parent869e9323652d5ee736bf9798b8f47a861fff30df (diff)
Change the vnode locking in exec to not keep the vnode locked almost all
the time. This could lead to problems when a process wants to do an exec on the same vnode it's being run from and needs to copy in arguments from an uncached page in the data segment. When that happens uvm detects a vnode deadlock and returns an error causing execve() return EFAULT. This fixes the regress test in regress/sys/kern/exec_self Also, initialize scriptvp early in exec_script because it could be used uninitialized in a failure case.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/ibcs2/ibcs2_exec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c
index a9f0dd811b9..1c6e28785c8 100644
--- a/sys/compat/ibcs2/ibcs2_exec.c
+++ b/sys/compat/ibcs2/ibcs2_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibcs2_exec.c,v 1.13 2002/03/14 01:26:50 millert Exp $ */
+/* $OpenBSD: ibcs2_exec.c,v 1.14 2002/08/22 22:04:42 art Exp $ */
/* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */
/*
@@ -298,7 +298,7 @@ coff_find_section(p, vp, fp, sh, s_type)
for (i = 0; i < fp->f_nscns; i++, pos += sizeof(struct coff_scnhdr)) {
siz = sizeof(struct coff_scnhdr);
error = vn_rdwr(UIO_READ, vp, (caddr_t) sh,
- siz, pos, UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
+ siz, pos, UIO_SYSSPACE, 0, p->p_ucred,
&resid, p);
if (error) {
DPRINTF(("section hdr %d read error %d\n", i, error));
@@ -619,7 +619,7 @@ exec_ibcs2_xout_prep_nmagic(p, epp, xp, xep)
xs = (struct xseg *)malloc(xep->xe_segsize, M_TEMP, M_WAITOK);
error = vn_rdwr(UIO_READ, epp->ep_vp, (caddr_t)xs,
xep->xe_segsize, xep->xe_segpos,
- UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred,
+ UIO_SYSSPACE, 0, p->p_ucred,
&resid, p);
if (error) {
DPRINTF(("segment table read error %d\n", error));