OSDN Git Service

IB/cm: Remove cma_multicast->igmp_joined
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 11 Jul 2018 08:20:29 +0000 (11:20 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 13 Jul 2018 18:18:55 +0000 (12:18 -0600)
commitc012691508f5fcc09b0a777fd1747f266093fe1b
tree9f0c1431fa05b09f8b0d964763c22a8a4114cdbe
parent1215cb7c88ec888d599a249142a74dd93b8985ad
IB/cm: Remove cma_multicast->igmp_joined

This variable isn't read and written to with proper locking, so it is
racy. Instead of using an unlocked bool use presence in the mc->list

The caller could race rdma_join_multicast with rdma_leave_multicast which
would leak a mc join and cause a use after free of mc.

Instead, do not add the mc to the list until it has completed
initialization, all mcs on the list require leaving.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/cma.c