aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 8003c91ccb9a..1fcca516e6ee 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -3269,7 +3269,7 @@ static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res)
3269static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res) 3269static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
3270{ 3270{
3271 __be32 *p; 3271 __be32 *p;
3272 uint32_t bmlen; 3272 uint32_t savewords, bmlen, i;
3273 int status; 3273 int status;
3274 3274
3275 status = decode_op_hdr(xdr, OP_OPEN); 3275 status = decode_op_hdr(xdr, OP_OPEN);
@@ -3287,7 +3287,12 @@ static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res)
3287 goto xdr_error; 3287 goto xdr_error;
3288 3288
3289 READ_BUF(bmlen << 2); 3289 READ_BUF(bmlen << 2);
3290 p += bmlen; 3290 savewords = min_t(uint32_t, bmlen, NFS4_BITMAP_SIZE);
3291 for (i = 0; i < savewords; ++i)
3292 READ32(res->attrset[i]);
3293 for (; i < NFS4_BITMAP_SIZE; i++)
3294 res->attrset[i] = 0;
3295
3291 return decode_delegation(xdr, res); 3296 return decode_delegation(xdr, res);
3292xdr_error: 3297xdr_error:
3293 dprintk("%s: Bitmap too large! Length = %u\n", __FUNCTION__, bmlen); 3298 dprintk("%s: Bitmap too large! Length = %u\n", __FUNCTION__, bmlen);