Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 2013 21:27:19 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r258145 - stable/8/sys/vm
Message-ID:  <201311142127.rAELRJia095730@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Nov 14 21:27:19 2013
New Revision: 258145
URL: http://svnweb.freebsd.org/changeset/base/258145

Log:
  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.

Modified:
  stable/8/sys/vm/vm_mmap.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/vm/   (props changed)

Modified: stable/8/sys/vm/vm_mmap.c
==============================================================================
--- stable/8/sys/vm/vm_mmap.c	Thu Nov 14 21:27:13 2013	(r258144)
+++ stable/8/sys/vm/vm_mmap.c	Thu Nov 14 21:27:19 2013	(r258145)
@@ -878,12 +878,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;
 			}
 
 			/*
@@ -919,12 +919,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;
 	}
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311142127.rAELRJia095730>