summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMark Zhang <markzhang@nvidia.com>2023-09-27 12:05:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-10 22:53:39 +0300
commit7de0e42444e9bc18214eff4aaa04de230eb9eb3d (patch)
tree59497aff0703af57a27d6445c88db4de87893d65 /drivers
parent36953b4da78bc296d203a25330c3192bcad1ccd9 (diff)
downloadlinux-7de0e42444e9bc18214eff4aaa04de230eb9eb3d.tar.xz
RDMA/cma: Initialize ib_sa_multicast structure to 0 when join
commit e0fe97efdb00f0f32b038a4836406a82886aec9c upstream. Initialize the structure to 0 so that it's fields won't have random values. For example fields like rec.traffic_class (as well as rec.flow_label and rec.sl) is used to generate the user AH through: cma_iboe_join_multicast cma_make_mc_event ib_init_ah_from_mcmember And a random traffic_class causes a random IP DSCP in RoCEv2. Fixes: b5de0c60cc30 ("RDMA/cma: Fix use after free race in roce multicast join") Signed-off-by: Mark Zhang <markzhang@nvidia.com> Link: https://lore.kernel.org/r/20230927090511.603595-1-markzhang@nvidia.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/core/cma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 805678f6fe57..0603d069de92 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -4723,7 +4723,7 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,
int err = 0;
struct sockaddr *addr = (struct sockaddr *)&mc->addr;
struct net_device *ndev = NULL;
- struct ib_sa_multicast ib;
+ struct ib_sa_multicast ib = {};
enum ib_gid_type gid_type;
bool send_only;