From owner-svn-src-all@FreeBSD.ORG Tue Nov 12 08:47:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 102C9E6E; Tue, 12 Nov 2013 08:47:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3CB92A29; Tue, 12 Nov 2013 08:47:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAC8lwvc053237; Tue, 12 Nov 2013 08:47:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAC8lwi8053235; Tue, 12 Nov 2013 08:47:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201311120847.rAC8lwi8053235@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 12 Nov 2013 08:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258039 - in head/sys: kern 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.16 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: Tue, 12 Nov 2013 08:47:59 -0000 Author: kib Date: Tue Nov 12 08:47:58 2013 New Revision: 258039 URL: http://svnweb.freebsd.org/changeset/base/258039 Log: Avoid overflow for the page counts. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c head/sys/vm/vm_fault.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Nov 12 08:32:10 2013 (r258038) +++ head/sys/kern/vfs_vnops.c Tue Nov 12 08:47:58 2013 (r258039) @@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio void *rl_cookie; struct mount *mp; vm_page_t *prev_td_ma; - int cnt, error, save, saveheld, prev_td_ma_cnt; + int error, save, saveheld, prev_td_ma_cnt; vm_offset_t addr, end; + vm_size_t cnt; vm_prot_t prot; size_t len, resid; ssize_t adv; Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Nov 12 08:32:10 2013 (r258038) +++ head/sys/vm/vm_fault.c Tue Nov 12 08:47:58 2013 (r258039) @@ -1074,7 +1074,7 @@ vm_fault_quick_hold_pages(vm_map_t map, { vm_offset_t end, va; vm_page_t *mp; - int count; + vm_size_t count; boolean_t pmap_failed; if (len == 0)