aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-25 13:04:59 -0400
committerRoland Dreier <roland@purestorage.com>2013-07-30 13:10:35 -0400
commit604296303f5f2698e4682c8aefb413554bc4b12a (patch)
treee422fd8d3ab1a0c381a2568fb7adadcbd4996625 /drivers/infiniband/hw
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
RDMA/nes: Fix info leaks in nes_create_qp() and nes_create_cq()
We pass a few bytes of uninitialized stack memory to the user here. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r--drivers/infiniband/hw/nes/nes_verbs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 8f67fe2e91e6..5b53ca5a2284 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1384,6 +1384,7 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
1384 1384
1385 if (ibpd->uobject) { 1385 if (ibpd->uobject) {
1386 uresp.mmap_sq_db_index = nesqp->mmap_sq_db_index; 1386 uresp.mmap_sq_db_index = nesqp->mmap_sq_db_index;
1387 uresp.mmap_rq_db_index = 0;
1387 uresp.actual_sq_size = sq_size; 1388 uresp.actual_sq_size = sq_size;
1388 uresp.actual_rq_size = rq_size; 1389 uresp.actual_rq_size = rq_size;
1389 uresp.qp_id = nesqp->hwqp.qp_id; 1390 uresp.qp_id = nesqp->hwqp.qp_id;
@@ -1767,7 +1768,7 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev, int entries,
1767 resp.cq_id = nescq->hw_cq.cq_number; 1768 resp.cq_id = nescq->hw_cq.cq_number;
1768 resp.cq_size = nescq->hw_cq.cq_size; 1769 resp.cq_size = nescq->hw_cq.cq_size;
1769 resp.mmap_db_index = 0; 1770 resp.mmap_db_index = 0;
1770 if (ib_copy_to_udata(udata, &resp, sizeof resp)) { 1771 if (ib_copy_to_udata(udata, &resp, sizeof resp - sizeof resp.reserved)) {
1771 nes_free_resource(nesadapter, nesadapter->allocated_cqs, cq_num); 1772 nes_free_resource(nesadapter, nesadapter->allocated_cqs, cq_num);
1772 kfree(nescq); 1773 kfree(nescq);
1773 return ERR_PTR(-EFAULT); 1774 return ERR_PTR(-EFAULT);