aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-03-21 12:10:36 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-03-22 05:34:13 -0400
commit556ae3bb32cabe483375b857dda1322384c57b65 (patch)
treebad9e8bbf7dbb8d194346c8904dcfe172a94c7f0 /fs/nfs/nfs4xdr.c
parentf1f0abe192a72e75d7c59972e30784d043fd8d73 (diff)
NFS: don't try to decode GETATTR if DELEGRETURN returned error
The reply parsing code attempts to decode the GETATTR response even if the DELEGRETURN portion of the compound returned an error. The GETATTR response won't actually exist if that's the case and we're asking the parser to read past the end of the response. This bug is fairly benign. The parser catches this without reading past the end of the response and decode_getfattr returns -EIO. Earlier kernels however had decode_op_hdr using the READ_BUF macro, and this bug would make this printk pop any time the client got an error from a delegreturn: kernel: decode_op_hdr: reply buffer overflowed in line XXXX More recent kernels seem to have replaced this printk with a dprintk. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 4d338be492cb..dd17713413a5 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -5552,6 +5552,8 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nf
5552 if (status != 0) 5552 if (status != 0)
5553 goto out; 5553 goto out;
5554 status = decode_delegreturn(&xdr); 5554 status = decode_delegreturn(&xdr);
5555 if (status != 0)
5556 goto out;
5555 decode_getfattr(&xdr, res->fattr, res->server, 5557 decode_getfattr(&xdr, res->fattr, res->server,
5556 !RPC_IS_ASYNC(rqstp->rq_task)); 5558 !RPC_IS_ASYNC(rqstp->rq_task));
5557out: 5559out: