summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2000-12-23 19:43:10 +0000
committerjake <jake@FreeBSD.org>2000-12-23 19:43:10 +0000
commitfa7a58ab48542df270919dc02881d5c4a2d4f344 (patch)
tree51c7f08e6064351afd60db7b45fcd14756284805 /sys/i386
parent974f411f61d6549db784519d520f6a33719e3f6c (diff)
downloadFreeBSD-src-fa7a58ab48542df270919dc02881d5c4a2d4f344.zip
FreeBSD-src-fa7a58ab48542df270919dc02881d5c4a2d4f344.tar.gz
Protect proc.p_pptr and proc.p_children/p_sibling with the
proctree_lock. linprocfs not locked pending response from informal maintainer. Reviewed by: jhb, -smp@
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/vm_machdep.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index dcf4986..0a3bc51 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -259,6 +259,18 @@ cpu_exit(p)
mtx_enter(&sched_lock, MTX_SPIN);
mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH);
mtx_assert(&Giant, MA_NOTOWNED);
+
+ /*
+ * We have to wait until after releasing all locks before
+ * changing p_stat. If we block on a mutex then we will be
+ * back at SRUN when we resume and our parent will never
+ * harvest us.
+ */
+ p->p_stat = SZOMB;
+
+ mp_fixme("assumption: p_pptr won't change at this time");
+ wakeup(p->p_pptr);
+
cnt.v_swtch++;
cpu_throw();
panic("cpu_exit");
OpenPOWER on IntegriCloud