summaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-06-17 21:47:53 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-11 05:40:27 +0200
commitdce34ce298d85b81630401f4feb4bd7ac77fe9c7 (patch)
tree9caa66cd3f03d500fdef5df290de23695589026d /fs/nfs/pagelist.c
parentNFS: Remove the redundant 'dirty' and 'commit' lists from nfs_inode (diff)
downloadlinux-dce34ce298d85b81630401f4feb4bd7ac77fe9c7.tar.xz
linux-dce34ce298d85b81630401f4feb4bd7ac77fe9c7.zip
NFS: Prevent integer overflow in nfs_scan_list()
Also ensure that nfs_inode ncommit and npages are large enough to represent all possible values for the number of pages. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index ad90cbe76703..68f6bf122006 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -425,6 +425,8 @@ int nfs_scan_list(struct nfs_inode *nfsi,
req->wb_index, tag);
nfs_list_add_request(req, dst);
res++;
+ if (res == INT_MAX)
+ goto out;
}
}