RDMA/cma: Do not ignore net namespace for unbound cm_id
authorParav Pandit <parav@mellanox.com>
Mon, 16 Jul 2018 08:50:13 +0000 (11:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2018 20:43:45 +0000 (22:43 +0200)
commitbdbf6e0b93261127196a6dbfc180aabf44e1a296
tree3382d402800e0deb7029ce77b823479ec27850e7
parent0d1d365d1d4423b55e3a18e1d1ad2036aa1708ea
RDMA/cma: Do not ignore net namespace for unbound cm_id

[ Upstream commit 643d213a9a034fa04f5575a40dfc8548e33ce04f ]

Currently if the cm_id is not bound to any netdevice, than for such cm_id,
net namespace is ignored; which is incorrect.

Regardless of cm_id bound to a netdevice or not, net namespace must
match. When a cm_id is bound to a netdevice, in such case net namespace
and netdevice both must match.

Fixes: 4c21b5bcef73 ("IB/cma: Add net_dev and private data checks to RDMA CM")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/cma.c