Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Nov 2013 08:47:58 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r258039 - in head/sys: kern vm
Message-ID:  <201311120847.rAC8lwi8053235@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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