Date: Fri, 3 Mar 2017 10:02:56 +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: r314589 - stable/11/sys/vm Message-ID: <201703031002.v23A2uFr004954@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Mar 3 10:02:56 2017 New Revision: 314589 URL: https://svnweb.freebsd.org/changeset/base/314589 Log: MFC r314195: Properly handle possible underflow in vm_fault_prefault(). Modified: stable/11/sys/vm/vm_fault.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_fault.c ============================================================================== --- stable/11/sys/vm/vm_fault.c Fri Mar 3 08:13:45 2017 (r314588) +++ stable/11/sys/vm/vm_fault.c Fri Mar 3 10:02:56 2017 (r314589) @@ -1372,11 +1372,12 @@ vm_fault_prefault(const struct faultstat entry = fs->entry; - starta = addra - backward * PAGE_SIZE; - if (starta < entry->start) { + if (addra < backward * PAGE_SIZE) { starta = entry->start; - } else if (starta > addra) { - starta = 0; + } else { + starta = addra - backward * PAGE_SIZE; + if (starta < entry->start) + starta = entry->start; } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703031002.v23A2uFr004954>