diff options
author | Peng Tao <bergwolf@gmail.com> | 2011-10-23 23:22:38 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-10-31 11:51:28 -0400 |
commit | d743c3c9c236cc61403a4f7d6283d59ddf68b2bd (patch) | |
tree | 9eb73b3ba65167f61f8b455c8d54ff68a1905b2e /fs/nfs | |
parent | 92407e75ce45b41c46944891711fd8faf0714d84 (diff) |
NFS4: fix cb_recallany decode error
craa_type_mask is bitmap4 per RFC5661. We need to expect a length before
extracting bitmap value.
Cc: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | 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 918ad647afea..ee1a5b3cd48d 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, | |||
488 | struct xdr_stream *xdr, | 488 | struct xdr_stream *xdr, |
489 | struct cb_recallanyargs *args) | 489 | struct cb_recallanyargs *args) |
490 | { | 490 | { |
491 | __be32 *p; | 491 | uint32_t bitmap[2]; |
492 | __be32 *p, status; | ||
492 | 493 | ||
493 | args->craa_addr = svc_addr(rqstp); | 494 | args->craa_addr = svc_addr(rqstp); |
494 | p = read_buf(xdr, 4); | 495 | p = read_buf(xdr, 4); |
495 | if (unlikely(p == NULL)) | 496 | if (unlikely(p == NULL)) |
496 | return htonl(NFS4ERR_BADXDR); | 497 | return htonl(NFS4ERR_BADXDR); |
497 | args->craa_objs_to_keep = ntohl(*p++); | 498 | args->craa_objs_to_keep = ntohl(*p++); |
498 | p = read_buf(xdr, 4); | 499 | status = decode_bitmap(xdr, bitmap); |
499 | if (unlikely(p == NULL)) | 500 | if (unlikely(status)) |
500 | return htonl(NFS4ERR_BADXDR); | 501 | return status; |
501 | args->craa_type_mask = ntohl(*p); | 502 | args->craa_type_mask = bitmap[0]; |
502 | 503 | ||
503 | return 0; | 504 | return 0; |
504 | } | 505 | } |