]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita09b3d0e9d31441f67afb64aac327f597520ec26
tree9f0c1431fa05b09f8b0d964763c22a8a4114cdbe
parent3a074b440d13bb406257159ce9ead4da4960baaa
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