From: Trond Myklebust <trond.myklebust@fys.uio.no>

Fixes the Oops reported by Paul Blazejowski. Bug turned out to be in the
page overflow checking for READDIRPLUS.

Cheers,
  Trond



---

 25-akpm/fs/nfs/nfs3xdr.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN fs/nfs/nfs3xdr.c~nfs-readdirplus-overflow-fix fs/nfs/nfs3xdr.c
--- 25/fs/nfs/nfs3xdr.c~nfs-readdirplus-overflow-fix	Mon Apr  5 14:59:10 2004
+++ 25-akpm/fs/nfs/nfs3xdr.c	Mon Apr  5 14:59:10 2004
@@ -536,16 +536,16 @@ nfs3_xdr_readdirres(struct rpc_rqst *req
 
 		if (res->plus) {
 			/* post_op_attr */
-			if (p > end)
+			if (p + 2 > end)
 				goto short_pkt;
 			if (*p++) {
 				p += 21;
-				if (p > end)
+				if (p + 1 > end)
 					goto short_pkt;
 			}
 			/* post_op_fh3 */
 			if (*p++) {
-				if (p > end)
+				if (p + 1 > end)
 					goto short_pkt;
 				len = ntohl(*p++);
 				if (len > NFS3_FHSIZE) {

_