RDMA/cma: Initialize ib_sa_multicast structure to 0 when join
authorMark Zhang <markzhang@nvidia.com>
Wed, 27 Sep 2023 09:05:11 +0000 (12:05 +0300)
committerLeon Romanovsky <leon@kernel.org>
Mon, 2 Oct 2023 10:10:40 +0000 (13:10 +0300)
commite0fe97efdb00f0f32b038a4836406a82886aec9c
tree0ec9f51072e4222c14d5c58f266e58ded7b58094
parent374012b0045780b7ad498be62e85153009bb7fe9
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: 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>
drivers/infiniband/core/cma.c