From f6e7bb08958dcfe7a672c7db86ef2387219fa85a Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Thu, 6 Apr 2006 21:43:29 +0000 Subject: release kernel lock _after_ the emulation exit hook is called to protect possible free()s; tedu@ deraadt@ ok --- sys/kern/kern_exit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys') 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 -- cgit v1.2.3