summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_aout.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-01-24 00:27:28 +0000
committerjhb <jhb@FreeBSD.org>2001-01-24 00:27:28 +0000
commita294d4e362c79943729544b2c37f98be3a6f0dac (patch)
tree8794f893081a4e5c2206a94c71a5af5f035f04b7 /sys/kern/imgact_aout.c
parentf540aca98452ae3328bb85b3019b403196f8d16d (diff)
downloadFreeBSD-src-a294d4e362c79943729544b2c37f98be3a6f0dac.zip
FreeBSD-src-a294d4e362c79943729544b2c37f98be3a6f0dac.tar.gz
Proc locking.
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r--sys/kern/imgact_aout.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c
index 6e0edde..ff315f5 100644
--- a/sys/kern/imgact_aout.c
+++ b/sys/kern/imgact_aout.c
@@ -155,6 +155,7 @@ exec_aout_imgact(imgp)
/*
* text/data/bss must not exceed limits
*/
+ mtx_assert(&Giant, MA_OWNED);
if (/* text can't exceed maximum text size */
a_out->a_text > MAXTSIZ ||
@@ -248,13 +249,17 @@ aout_coredump(p, vp, limit)
register struct vnode *vp;
off_t limit;
{
- register struct ucred *cred = p->p_ucred;
+ register struct ucred *cred;
register struct vmspace *vm = p->p_vmspace;
int error;
if (ctob(UPAGES + vm->vm_dsize + vm->vm_ssize) >= limit)
return (EFAULT);
fill_kinfo_proc(p, &p->p_addr->u_kproc);
+ PROC_LOCK(p);
+ cred = p->p_ucred;
+ crhold(cred);
+ PROC_UNLOCK(p);
error = cpu_coredump(p, vp, cred);
if (error == 0)
error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr,
@@ -266,6 +271,7 @@ aout_coredump(p, vp, limit)
round_page(ctob(vm->vm_ssize)),
(off_t)ctob(UPAGES) + ctob(vm->vm_dsize), UIO_USERSPACE,
IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p);
+ crfree(cred);
return (error);
}
OpenPOWER on IntegriCloud