Skip to content

Commit

Permalink
NFS: Buffer overflow in ->decode_dirent() should not be fatal
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Nov 22, 2010
1 parent b47d19d commit 463a376
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/nfs/nfs2xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/nfs3xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 463a376

Please sign in to comment.