[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170904112316.23832-1-colin.king@canonical.com>
Date: Mon, 4 Sep 2017 12:23:16 +0100
From: Colin King <colin.king@...onical.com>
To: Faisal Latif <faisal.latif@...el.com>,
Doug Ledford <dledford@...hat.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
linux-rdma@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, stable@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] RDMA/nes: do not leak uninitialized resp.reserved to userspace
From: Colin Ian King <colin.king@...onical.com>
resp.reserved has not been initialized and so the copy_to_user (via
ib_copy_to_udata) is copying uninitialized data from the stack back
to user space which is a potential information leak. Fix this by
setting resp.reserved to zero.
Fixes: 3c2d774cad5b ("RDMA/nes: Add a driver for NetEffect RNICs")
Cc: <stable@...r.kernel.org> [2.6.24+]
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/infiniband/hw/nes/nes_verbs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index f0dc5f4aa177..052c3822dfed 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1666,6 +1666,7 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev,
resp.cq_id = nescq->hw_cq.cq_number;
resp.cq_size = nescq->hw_cq.cq_size;
resp.mmap_db_index = 0;
+ resp.reserved = 0;
if (ib_copy_to_udata(udata, &resp, sizeof resp - sizeof resp.reserved)) {
nes_free_resource(nesadapter, nesadapter->allocated_cqs, cq_num);
kfree(nescq);
--
2.14.1
Powered by blists - more mailing lists