From: Simon Schubert Date: Tue, 6 Jan 2009 02:18:30 +0000 (+0100) Subject: Properly initialize the new vmspace and register its pmap. X-Git-Tag: v2.3.0~83 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/c75ceda3a3fe7a9bc5f8f9a5ba9cfb726afc1c9f Properly initialize the new vmspace and register its pmap. Without this the vmspace's pmap would not be in the global pmap_list. This later leads to a panic when sys_exec_sys_unregister releases the vmspace. Reported-by: Christian Sturm --- diff --git a/sys/kern/imgact_resident.c b/sys/kern/imgact_resident.c index 0107c55feb..6389c0e42b 100644 --- a/sys/kern/imgact_resident.c +++ b/sys/kern/imgact_resident.c @@ -212,6 +212,7 @@ sys_exec_sys_register(struct exec_sys_register_args *uap) vmres->vr_id = ++exec_res_id; vmres->vr_entry_addr = (intptr_t)uap->entry; vmres->vr_vmspace = vmspace_fork(p->p_vmspace); /* XXX order */ + pmap_pinit2(vmspace_pmap(vmres->vr_vmspace)); lockmgr(&exec_list_lock, LK_EXCLUSIVE); TAILQ_INSERT_TAIL(&exec_res_list, vmres, vr_link);