diff options
author | jeff <jeff@FreeBSD.org> | 2002-08-13 06:55:28 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-08-13 06:55:28 +0000 |
commit | a996673e123dab0805b05084774227cae72d75e5 (patch) | |
tree | 9e630263213e8fdda8c938a92f150220b0eb745d /sys/kern/imgact_elf.c | |
parent | 216ea61cb629b077f8cf1b29f90f2c08ff1b1eea (diff) | |
download | FreeBSD-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/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 92e86af..7d79c1d 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -599,6 +599,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) const char *interp = NULL; Elf_Brandinfo *brand_info; char *path; + struct thread *td = curthread; GIANT_REQUIRED; @@ -624,16 +625,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) * From this point on, we may have resources that need to be freed. */ - /* - * Yeah, I'm paranoid. There is every reason in the world to get - * VTEXT now since from here on out, there are places we can have - * a context switch. Better safe than sorry; I really don't want - * the file to change while it's being loaded. - * - * XXX We can't really set this flag safely without the vnode lock. - */ - mp_fixme("This needs the vnode lock to be safe."); - imgp->vp->v_vflag |= VV_TEXT; + VOP_UNLOCK(imgp->vp, 0, td); if ((error = exec_extract_strings(imgp)) != 0) goto fail; @@ -846,6 +838,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) imgp->interpreted = 0; fail: + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY, td); return error; } |