Skip to content

Commit e0fe97e

Browse files
MarkZhang81rleon
authored andcommitted
RDMA/cma: Initialize ib_sa_multicast structure to 0 when join
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: b5de0c6 ("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>
1 parent 374012b commit e0fe97e

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/core

1 file changed

+1
-1
lines changed

drivers/infiniband/core/cma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4968,7 +4968,7 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,
49684968
int err = 0;
49694969
struct sockaddr *addr = (struct sockaddr *)&mc->addr;
49704970
struct net_device *ndev = NULL;
4971-
struct ib_sa_multicast ib;
4971+
struct ib_sa_multicast ib = {};
49724972
enum ib_gid_type gid_type;
49734973
bool send_only;
49744974

0 commit comments

Comments
 (0)