Ensure map is valid, even before userland exists and the fault address

register points to an address in the userland range.

Obtained from:	ABT Systems Ltd
MFC after:	1 week
Sponsored by:	the FreeBSD Foundation
This commit is contained in:
andrew 2016-08-22 18:19:46 +00:00
parent 80de374f97
commit 69b3f4f99d

View File

@ -184,10 +184,13 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower)
map = &p->p_vmspace->vm_map;
else {
/* The top bit tells us which range to use */
if ((far >> 63) == 1)
if ((far >> 63) == 1) {
map = kernel_map;
else
} else {
map = &p->p_vmspace->vm_map;
if (map == NULL)
map = kernel_map;
}
}
if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)