]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
NFS: Buffer overflow in ->decode_dirent() should not be fatal
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 20 Nov 2010 17:22:20 +0000 (12:22 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 22 Nov 2010 18:24:43 +0000 (13:24 -0500)
Overflowing the buffer in the readdir ->decode_dirent() should not lead to
a fatal error, but rather to an attempt to reread the record in question.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs2xdr.c
fs/nfs/nfs3xdr.c
fs/nfs/nfs4xdr.c

index 2563f765c9b4ba49b37615657f4c3f5f76e7576d..ab5937734f0b527cdbd2349625de3021b6efbb6f 100644 (file)
@@ -495,7 +495,7 @@ nfs_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, struct nfs_se
 
 out_overflow:
        print_overflow_msg(__func__, xdr);
-       return ERR_PTR(-EIO);
+       return ERR_PTR(-EAGAIN);
 }
 
 /*
index 748dc91a4a147466529d9b1b49a20cc0ab2aad93..e79e4f5f5d53ba3e9d838a86511c65e58f8a01d5 100644 (file)
@@ -656,7 +656,7 @@ nfs3_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, struct nfs_s
 out_overflow:
        print_overflow_msg(__func__, xdr);
 out_overflow_exit:
-       return ERR_PTR(-EIO);
+       return ERR_PTR(-EAGAIN);
 }
 
 /*
index b7a204ff6fe1504efe287b7620532407cc692f89..a3b39cbc90f9c98e28a9c1228a5840dd34657ead 100644 (file)
@@ -6221,7 +6221,7 @@ __be32 *nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
 
 out_overflow:
        print_overflow_msg(__func__, xdr);
-       return ERR_PTR(-EIO);
+       return ERR_PTR(-EAGAIN);
 }
 
 /*