RDMA/cma: Use correct address when leaving multicast group
authorMaor Gottlieb <maorg@nvidia.com>
Tue, 18 Jan 2022 07:35:00 +0000 (09:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 17:34:06 +0000 (18:34 +0100)
commit7715682f357db296cbc70faa945994f75bd06357
tree3f0d65290fa9208d208e53c67c5443127fd89587
parent0452c3dc851bf0f71bd6115082ed267efe9ca705
RDMA/cma: Use correct address when leaving multicast group

commit d9e410ebbed9d091b97bdf45b8a3792e2878dc48 upstream.

In RoCE we should use cma_iboe_set_mgid() and not cma_set_mgid to generate
the mgid, otherwise we will generate an IGMP for an incorrect address.

Fixes: b5de0c60cc30 ("RDMA/cma: Fix use after free race in roce multicast join")
Link: https://lore.kernel.org/r/913bc6783fd7a95fe71ad9454e01653ee6fb4a9a.1642491047.git.leonro@nvidia.com
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/cma.c