linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 RESEND] NFS4: fix cb_recallany decode error
@ 2011-10-31 15:15 Peng Tao
  2011-10-31 15:15 ` [PATCH 2/2] nfs41: handle BLK_LAYOUT CB_RECALL_ANY Peng Tao
  0 siblings, 1 reply; 18+ messages in thread
From: Peng Tao @ 2011-10-31 15:15 UTC (permalink / raw)
  To: linux-nfs; +Cc: Trond.Myklebust, bhalevy, Peng Tao

craa_type_mask is bitmap4 according to RFC5661. We need to expect a length before
extracting its value.

Signed-off-by: Peng Tao <peng_tao@emc.com>
---
Resend this one as it is a dependency for "[PATCH 2/2] nfs41: handle BLK_LAYOUT CB_RECALL_ANY".

 fs/nfs/callback_xdr.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 918ad64..ee1a5b3 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -488,17 +488,18 @@ static __be32 decode_recallany_args(struct svc_rqst *rqstp,
 				      struct xdr_stream *xdr,
 				      struct cb_recallanyargs *args)
 {
-	__be32 *p;
+	uint32_t bitmap[2];
+	__be32 *p, status;
 
 	args->craa_addr = svc_addr(rqstp);
 	p = read_buf(xdr, 4);
 	if (unlikely(p == NULL))
 		return htonl(NFS4ERR_BADXDR);
 	args->craa_objs_to_keep = ntohl(*p++);
-	p = read_buf(xdr, 4);
-	if (unlikely(p == NULL))
-		return htonl(NFS4ERR_BADXDR);
-	args->craa_type_mask = ntohl(*p);
+	status = decode_bitmap(xdr, bitmap);
+	if (unlikely(status))
+		return status;
+	args->craa_type_mask = bitmap[0];
 
 	return 0;
 }
-- 
1.7.1.262.g5ef3d


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

end of thread, other threads:[~2011-11-04  1:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 15:15 [PATCH 1/2 RESEND] NFS4: fix cb_recallany decode error Peng Tao
2011-10-31 15:15 ` [PATCH 2/2] nfs41: handle BLK_LAYOUT CB_RECALL_ANY Peng Tao
2011-10-31 15:49   ` Trond Myklebust
2011-10-31 16:38     ` Peng Tao
2011-10-31 16:45       ` Trond Myklebust
2011-10-31 17:02         ` Peng Tao
2011-10-31 17:08         ` Benny Halevy
2011-10-31 17:42           ` Trond Myklebust
2011-10-31 17:57             ` Benny Halevy
2011-10-31 18:20               ` Trond Myklebust
2011-10-31 18:23                 ` [nfsv4] " Matt W. Benjamin
2011-10-31 18:31                   ` Trond Myklebust
2011-10-31 18:31                 ` Jim Rees
2011-10-31 18:39                   ` Trond Myklebust
2011-11-01  5:29                     ` tao.peng
2011-11-04  1:33                       ` tao.peng
2011-10-31 21:42                   ` [nfsv4] " Welch, Brent
2011-11-01 14:59                     ` david.noveck

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).