diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index d6545ba5f479..c56e51f3dbfe 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1739,6 +1739,13 @@ vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map, dst_m = src_m; if (vm_page_sleep_if_busy(dst_m, "fltupg")) goto again; + if (dst_m->pindex >= dst_object->size) + /* + * We are upgrading. Index can occur + * out of bounds if the object type is + * vnode and the file was truncated. + */ + break; vm_page_xbusy(dst_m); KASSERT(dst_m->valid == VM_PAGE_BITS_ALL, ("invalid dst page %p", dst_m));