From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Thu, 25 Jul 2013 17:04:09 +0000 Subject: [patch] RDMA/cxgb3: stack info leak in iwch_craete_cq() Message-Id: <20130725170409.GB7026@elgon.mountain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Steve Wise Cc: Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org The "uresp.reserved" field isn't initialized. It's at the end, of the struct here so we don't need to copy it to the user. Signed-off-by: Dan Carpenter diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index e87f220..b8e26f2 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -226,7 +226,7 @@ static struct ib_cq *iwch_create_cq(struct ib_device *ibdev, int entries, int ve mm->len = PAGE_ALIGN(((1UL << uresp.size_log2) + 1) * sizeof(struct t3_cqe)); uresp.memsize = mm->len; - resplen = sizeof uresp; + resplen = sizeof uresp - sizeof uresp.reserved; } if (ib_copy_to_udata(udata, &uresp, resplen)) { kfree(mm);