Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2014 12:35:19 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r265438 - stable/9/sys/vm
Message-ID:  <201405061235.s46CZJ9a089186@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue May  6 12:35:19 2014
New Revision: 265438
URL: http://svnweb.freebsd.org/changeset/base/265438

Log:
  MFC r265100:
  Fix the comparision for the end of range in vm_phys_fictitious_reg_range().

Modified:
  stable/9/sys/vm/vm_phys.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/vm_phys.c
==============================================================================
--- stable/9/sys/vm/vm_phys.c	Tue May  6 12:31:25 2014	(r265437)
+++ stable/9/sys/vm/vm_phys.c	Tue May  6 12:35:19 2014	(r265438)
@@ -600,7 +600,9 @@ vm_phys_fictitious_reg_range(vm_paddr_t 
 
 #ifdef VM_PHYSSEG_DENSE
 	pi = atop(start);
-	if (pi >= first_page && atop(end) < vm_page_array_size) {
+	if (pi >= first_page && pi < vm_page_array_size + first_page) {
+		if (atop(end) >= vm_page_array_size + first_page)
+			return (EINVAL);
 		fp = &vm_page_array[pi - first_page];
 		malloced = FALSE;
 	} else



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