summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-09-12 20:46:32 +0000
committerjhb <jhb@FreeBSD.org>2013-09-12 20:46:32 +0000
commit3c31e1fb755bb2eeb23ed1466712f9163ac3d525 (patch)
treeb11bbb147aa1319961464b5cc5d6efe0bcec3679
parent3e063dc0d0da1f946598c6894758a6ddf3de60f6 (diff)
downloadFreeBSD-src-3c31e1fb755bb2eeb23ed1466712f9163ac3d525.zip
FreeBSD-src-3c31e1fb755bb2eeb23ed1466712f9163ac3d525.tar.gz
Fix an off-by-one error when populating mincore(2) entries for
skipped entries. lastvecindex references the last valid byte, so the new bytes should come after it. Approved by: re (kib) MFC after: 1 week
-rw-r--r--sys/vm/vm_mmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 9548485..0f2d531 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -984,12 +984,12 @@ RestartScan:
* the byte vector is zeroed for those skipped entries.
*/
while ((lastvecindex + 1) < vecindex) {
+ ++lastvecindex;
error = subyte(vec + lastvecindex, 0);
if (error) {
error = EFAULT;
goto done2;
}
- ++lastvecindex;
}
/*
@@ -1025,12 +1025,12 @@ RestartScan:
*/
vecindex = OFF_TO_IDX(end - first_addr);
while ((lastvecindex + 1) < vecindex) {
+ ++lastvecindex;
error = subyte(vec + lastvecindex, 0);
if (error) {
error = EFAULT;
goto done2;
}
- ++lastvecindex;
}
/*
OpenPOWER on IntegriCloud