aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/infiniband/core/sa_query.c
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2016-05-06 22:45:26 +0300
committerDoug Ledford <dledford@redhat.com>2016-05-13 19:40:02 -0400
commit2fa2d4fb1166d1ef35f0aacac6165d53ab1b89c7 (patch)
tree01243aeb604a4d0e12d369efc8092f7a89dfe9de /drivers/infiniband/core/sa_query.c
parentIB/core: Remove unnecessary check in ibnl_rcv_msg (diff)
downloadwireguard-linux-2fa2d4fb1166d1ef35f0aacac6165d53ab1b89c7.tar.xz
wireguard-linux-2fa2d4fb1166d1ef35f0aacac6165d53ab1b89c7.zip
IB/core: Fix a potential array overrun in CMA and SA agent
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>
Diffstat (limited to 'drivers/infiniband/core/sa_query.c')
-rw-r--r--drivers/infiniband/core/sa_query.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index 8a09c0fb268d..1e7c652fa8a5 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -1820,7 +1820,7 @@ static int __init ib_sa_init(void)
goto err3;
}
- if (ibnl_add_client(RDMA_NL_LS, RDMA_NL_LS_NUM_OPS,
+ if (ibnl_add_client(RDMA_NL_LS, ARRAY_SIZE(ib_sa_cb_table),
ib_sa_cb_table)) {
pr_err("Failed to add netlink callback\n");
ret = -EINVAL;