浏览代码

NFSv4.1: decode_getdeviceinfo should check xdr_read_pages() return value

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust 13 年之前
父节点
当前提交
13fe4ba1b6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      fs/nfs/nfs4xdr.c

+ 2 - 1
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
 	 * and places the remaining xdr data in xdr_buf->tail
 	 */
 	 */
 	pdev->mincount = be32_to_cpup(p);
 	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. */
 	/* Parse notification bitmap, verifying that it is zero. */
 	p = xdr_inline_decode(xdr, 4);
 	p = xdr_inline_decode(xdr, 4);