summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2006-04-06 21:43:29 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2006-04-06 21:43:29 +0000
commitf6e7bb08958dcfe7a672c7db86ef2387219fa85a (patch)
treecfc8fbc21a998acf6500f98b473a845c31ebf51b /sys/kern
parent269dd1e1030e9bdfeef17cb4cc558fbf9c127b17 (diff)
release kernel lock _after_ the emulation exit hook is called to protect possible free()s; tedu@ deraadt@ ok
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_exit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index de17c48b68b..bb4c2adfc5f 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.59 2006/02/20 19:39:11 miod Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.60 2006/04/06 21:43:28 mickey Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -338,15 +338,15 @@ exit1(struct proc *p, int rv, int flags)
limfree(p->p_limit);
p->p_limit = NULL;
- /* This process no longer needs to hold the kernel lock. */
- KERNEL_PROC_UNLOCK(p);
-
/*
* If emulation has process exit hook, call it now.
*/
if (p->p_emul->e_proc_exit)
(*p->p_emul->e_proc_exit)(p);
+ /* This process no longer needs to hold the kernel lock. */
+ KERNEL_PROC_UNLOCK(p);
+
/*
* Finally, call machine-dependent code to switch to a new
* context (possibly the idle context). Once we are no longer