RDMA/cma: Check existence of netdevice during port validation
authorParav Pandit <parav@mellanox.com>
Tue, 9 Jan 2018 13:58:54 +0000 (15:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:09 +0000 (11:02 +0200)
commit889177d172d3a1879742cdd17debbbeb300ca1b5
treebe267de20cd07103957a8cd7f9c66a1c306144a0
parent48b8839d91a49cde35ddab422a99ef908391aeee
RDMA/cma: Check existence of netdevice during port validation

[ Upstream commit 00db63c128dd3daf38f481371976c24d32678142 ]

If valid netdevice is not found for RoCE, GID table should not be
searched with NULL netdevice.

Doing so causes the search routines to ignore the netdev argument and may
match the wrong GID table entry if the netdev is deleted.

Fixes: abae1b71dd37 ("IB/cma: cma_validate_port should verify the port and netdevice")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
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