From owner-svn-src-all@freebsd.org Sun Mar 19 14:42:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AB1FD1210B; Sun, 19 Mar 2017 14:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A424F24; Sun, 19 Mar 2017 14:42:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2JEgGwZ073458; Sun, 19 Mar 2017 14:42:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2JEgGTx073457; Sun, 19 Mar 2017 14:42:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703191442.v2JEgGTx073457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Mar 2017 14:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315552 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Mar 2017 14:42:17 -0000 Author: kib Date: Sun Mar 19 14:42:16 2017 New Revision: 315552 URL: https://svnweb.freebsd.org/changeset/base/315552 Log: Fix off-by-one in the vm_fault_populate() code. When re-calculating the last inclusive page index after the pager call, -1 was erronously ommitted. If the pager extended the run (unlikely), the result would be insertion of the valid page mapping outside the current map entry range. Found by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Mar 19 14:40:01 2017 (r315551) +++ head/sys/vm/vm_fault.c Sun Mar 19 14:42:16 2017 (r315552) @@ -409,7 +409,7 @@ vm_fault_populate(struct faultstate *fs, vm_fault_populate_cleanup(fs->first_object, pager_first, map_first - 1); map_last = MIN(OFF_TO_IDX(fs->entry->end - fs->entry->start + - fs->entry->offset), pager_last); + fs->entry->offset) - 1, pager_last); if (map_last < pager_last) vm_fault_populate_cleanup(fs->first_object, map_last + 1, pager_last);