Merge rev 1.264 from i386/pmap.c (tegge via alfred):
Protect against an infinite loop when prefaulting pages. This can happen when the vm system maps past the end of an object or tries to map a zero length object, the pmap layer misses the fact that offsets wrap into negative numbers and we get stuck.
This commit is contained in:
parent
88b5258822
commit
303f52d500
@ -2444,8 +2444,11 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
|
||||
return;
|
||||
}
|
||||
|
||||
if (psize + pindex > object->size)
|
||||
if (psize + pindex > object->size) {
|
||||
if (object->size < pindex)
|
||||
return;
|
||||
psize = object->size - pindex;
|
||||
}
|
||||
|
||||
mpte = NULL;
|
||||
/*
|
||||
|
@ -1856,8 +1856,11 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr,
|
||||
return;
|
||||
}
|
||||
|
||||
if (psize + pindex > object->size)
|
||||
if (psize + pindex > object->size) {
|
||||
if (object->size < pindex)
|
||||
return;
|
||||
psize = object->size - pindex;
|
||||
}
|
||||
|
||||
/*
|
||||
* if we are processing a major portion of the object, then scan the
|
||||
|
Loading…
Reference in New Issue
Block a user