From 7b22d0a5d66776dc58e3d9e54b58bb678e2fa4c9 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 14 Nov 2013 21:27:13 +0000 Subject: [PATCH] MFC 255497: 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. git-svn-id: svn://svn.freebsd.org/base/stable/9@258144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/vm/vm_mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 3f923bd8a..4124d752e 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -963,12 +963,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; } /* @@ -1004,12 +1004,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; } /* -- 2.45.0