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


Groups > linux.kernel > #1461843 > unrolled thread

[PATCH 3.16 081/305] IB/core: Fix a potential array overrun in CMA and SA agent

Started byBen Hutchings <ben@decadent.org.uk>
First post2016-08-14 13:10 +0200
Last post2016-08-14 13:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 081/305] IB/core: Fix a potential array overrun in  CMA and SA agent Ben Hutchings <ben@decadent.org.uk> - 2016-08-14 13:10 +0200

#1461843 — [PATCH 3.16 081/305] IB/core: Fix a potential array overrun in CMA and SA agent

FromBen Hutchings <ben@decadent.org.uk>
Date2016-08-14 13:10 +0200
Subject[PATCH 3.16 081/305] IB/core: Fix a potential array overrun in CMA and SA agent
Message-ID<s61sK-7d0-33@gated-at.bofh.it>
3.16.37-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Mark Bloch <markb@mellanox.com>

commit 2fa2d4fb1166d1ef35f0aacac6165d53ab1b89c7 upstream.

Fix array overrun when going over callback table.
In declaration of callback table, the max size isn't provided and
in registration phase, it is provided.

There is potential scenario where a new operation is added
and it is not supported by current client. The acceptance of
such operation by ib_netlink will cause to array overrun.

Fixes: 809d5fc9bf65 ("infiniband: pass rdma_cm module to netlink_dump_start")
Fixes: b493d91d333e ("iwcm: common code for port mapper")
Fixes: 2ca546b92a02 ("IB/sa: Route SA pathrecord query through netlink")
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
[bwh: Backported to 3.16:
 - Only cma.c needs to be fixed
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -3679,7 +3679,8 @@ static int __init cma_init(void)
 	if (ret)
 		goto err;
 
-	if (ibnl_add_client(RDMA_NL_RDMA_CM, RDMA_NL_RDMA_CM_NUM_OPS, cma_cb_table))
+	if (ibnl_add_client(RDMA_NL_RDMA_CM, ARRAY_SIZE(cma_cb_table),
+			    cma_cb_table))
 		printk(KERN_WARNING "RDMA CMA: failed to add netlink callback\n");
 
 	return 0;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web