Avoid overflow for the page counts.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2013-11-12 08:47:58 +00:00
parent aae2e36cd5
commit d005ed537c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258039
2 changed files with 3 additions and 2 deletions

View File

@ -933,8 +933,9 @@ vn_io_fault(struct file *fp, struct uio *uio, struct ucred *active_cred,
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;

View File

@ -1074,7 +1074,7 @@ vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
{
vm_offset_t end, va;
vm_page_t *mp;
int count;
vm_size_t count;
boolean_t pmap_failed;
if (len == 0)