Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726066

[PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to userspace Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to userspace Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit
Date 2017-09-04 15:40 +0200
Message-ID <ulZLA-64y-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Colin Ian King <colin.king@canonical.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
initializing all of resp to zero.

V2: Initialize all of the struct rather than just resp.reserved as
suggested by Leon Romanovsky.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/infiniband/hw/nes/nes_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index f0dc5f4aa177..8998d11449c0 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1437,7 +1437,7 @@ static struct ib_cq *nes_create_cq(struct ib_device *ibdev,
 	struct nes_hw_cqp_wqe *cqp_wqe;
 	struct nes_pbl *nespbl = NULL;
 	struct nes_create_cq_req req;
-	struct nes_create_cq_resp resp;
+	struct nes_create_cq_resp resp = { 0 };
 	u32 cq_num = 0;
 	u32 opcode = 0;
 	u32 pbl_entries = 1;
-- 
2.14.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to userspace Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Colin King <colin.king@canonical.com> - 2017-09-04 15:40 +0200
  Re: [PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to  userspace Content-Type: text/plain; charset="utf-8"  Content-Transfer-Encoding: 8bit Leon Romanovsky <leon@kernel.org> - 2017-09-04 16:00 +0200
  Re: [PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to  userspace Content-Type: text/plain; charset="utf-8"  Content-Transfer-Encoding: 8bit Chien Tin Tung <chien.tin.tung@intel.com> - 2017-09-05 16:50 +0200
    Re: [PATCH][V2] RDMA/nes: do not leak uninitialized resp.reserved to  userspace Content-Type: text/plain; charset="utf-8"  Content-Transfer-Encoding: 8bit Colin Ian King <colin.king@canonical.com> - 2017-09-05 16:50 +0200

csiph-web