From: Trond Myklebust Date: Wed, 1 Aug 2012 18:21:12 +0000 (-0400) Subject: NFSv4.1: decode_getdeviceinfo should check xdr_read_pages() return value X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=13fe4ba1b64c099843c75b4f0633ad30a4526637;p=linux-beck.git NFSv4.1: decode_getdeviceinfo should check xdr_read_pages() return value Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 8dba6bd48557..a756349b0fa4 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -5642,7 +5642,8 @@ static int decode_getdeviceinfo(struct xdr_stream *xdr, * and places the remaining xdr data in xdr_buf->tail */ pdev->mincount = be32_to_cpup(p); - xdr_read_pages(xdr, pdev->mincount); /* include space for the length */ + if (xdr_read_pages(xdr, pdev->mincount) != pdev->mincount) + goto out_overflow; /* Parse notification bitmap, verifying that it is zero. */ p = xdr_inline_decode(xdr, 4);