linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] NFS: Buffer overflow in ->decode_dirent() should not be fatal
@ 2010-11-21 19:21 Trond Myklebust
  2010-11-21 19:21 ` [PATCH 2/8] NFS: Assume eof if the server returns no readdir records Trond Myklebust
  0 siblings, 1 reply; 8+ messages in thread
From: Trond Myklebust @ 2010-11-21 19:21 UTC (permalink / raw)
  To: linux-nfs

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 |    2 +-
 fs/nfs/nfs3xdr.c |    2 +-
 fs/nfs/nfs4xdr.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 2563f76..ab59377 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -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);
 }
 
 /*
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 748dc91..e79e4f5 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -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);
 }
 
 /*
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index b7a204f..a3b39cb 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -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);
 }
 
 /*
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-21 19:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-21 19:21 [PATCH 1/8] NFS: Buffer overflow in ->decode_dirent() should not be fatal Trond Myklebust
2010-11-21 19:21 ` [PATCH 2/8] NFS: Assume eof if the server returns no readdir records Trond Myklebust
2010-11-21 19:21   ` [PATCH 3/8] NFS: Fix a page leak in nfs_do_filldir() Trond Myklebust
2010-11-21 19:21     ` [PATCH 4/8] NFS: Fix a page leak in uncached_readdir() Trond Myklebust
2010-11-21 19:21       ` [PATCH 5/8] NFS: Fix the error handling in "uncached_readdir()" Trond Myklebust
2010-11-21 19:21         ` [PATCH 6/8] NFS: Don't ignore errors from nfs_do_filldir() Trond Myklebust
2010-11-21 19:21           ` [PATCH 7/8] NFS: Correct the array bound calculation in nfs_readdir_add_to_array Trond Myklebust
2010-11-21 19:21             ` [PATCH 8/8] NFS: Ensure we return the dirent->d_type when it is known Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).