summaryrefslogtreecommitdiffstats
path: root/sys/compat/pecoff
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-08-13 06:55:28 +0000
committerjeff <jeff@FreeBSD.org>2002-08-13 06:55:28 +0000
commita996673e123dab0805b05084774227cae72d75e5 (patch)
tree9e630263213e8fdda8c938a92f150220b0eb745d /sys/compat/pecoff
parent216ea61cb629b077f8cf1b29f90f2c08ff1b1eea (diff)
downloadFreeBSD-src-a996673e123dab0805b05084774227cae72d75e5.zip
FreeBSD-src-a996673e123dab0805b05084774227cae72d75e5.tar.gz
- Hold the vnode lock throughout execve.
- Set VV_TEXT in the top level execve code. - Fixup the image activators to deal with the newly locked vnode.
Diffstat (limited to 'sys/compat/pecoff')
-rw-r--r--sys/compat/pecoff/imgact_pecoff.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/compat/pecoff/imgact_pecoff.c b/sys/compat/pecoff/imgact_pecoff.c
index 175b021..f7b540c 100644
--- a/sys/compat/pecoff/imgact_pecoff.c
+++ b/sys/compat/pecoff/imgact_pecoff.c
@@ -533,8 +533,6 @@ exec_pecoff_coff_prep_zmagic(struct image_params * imgp,
imgp->auxarg_size = sizeof(struct pecoff_args);
imgp->interpreted = 0;
- mp_fixme("Unlocked vflag access.");
- imgp->vp->v_vflag |= VV_TEXT;
if (sh != NULL)
free(sh, M_TEMP);
return 0;
@@ -628,21 +626,26 @@ imgact_pecoff(struct image_params * imgp)
imgp->image_header;
struct coff_filehdr *fp;
int error, peofs;
+ struct thread *td = curthread;
+
error = pecoff_signature(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->vp, dp);
if (error) {
return -1;
}
+ VOP_UNLOCK(imgp->vp, 0, td);
+
peofs = dp->d_peofs + sizeof(signature) - 1;
fp = malloc(PECOFF_HDR_SIZE, M_TEMP, M_WAITOK);
error = pecoff_read_from(FIRST_THREAD_IN_PROC(imgp->proc),
imgp->vp, peofs, (caddr_t) fp, PECOFF_HDR_SIZE);
- if (error) {
- free(fp, M_TEMP);
- return error;
- }
+ if (error)
+ goto fail;
+
error = exec_pecoff_coff_makecmds(imgp, fp, peofs);
+fail:
free(fp, M_TEMP);
+ vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY, td);
return error;
}
OpenPOWER on IntegriCloud