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:
Peter Wemm 2001-11-16 02:28:33 +00:00
parent 88b5258822
commit 303f52d500
2 changed files with 8 additions and 2 deletions

View File

@ -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;
/*

View File

@ -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