Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2018 13:09:35 +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-11@freebsd.org
Subject:   svn commit: r331614 - stable/11/sys/vm
Message-ID:  <201803271309.w2RD9ZGC022908@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Mar 27 13:09:35 2018
New Revision: 331614
URL: https://svnweb.freebsd.org/changeset/base/331614

Log:
  MFC r331247:
  Check for wrap-around in vm_phys_alloc_seg_contig().

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

Modified: stable/11/sys/vm/vm_phys.c
==============================================================================
--- stable/11/sys/vm/vm_phys.c	Tue Mar 27 11:49:15 2018	(r331613)
+++ stable/11/sys/vm/vm_phys.c	Tue Mar 27 13:09:35 2018	(r331614)
@@ -1396,6 +1396,8 @@ vm_phys_alloc_seg_contig(struct vm_phys_seg *seg, u_lo
 					 */
 					pa = VM_PAGE_TO_PHYS(m_ret);
 					pa_end = pa + size;
+					if (pa_end < pa)
+						continue;
 					for (;;) {
 						pa += 1 << (PAGE_SHIFT +
 						    VM_NFREEORDER - 1);



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