]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
RDMA/core: Do not use invalid destination in determining port reuse
authorTatyana Nikolova <tatyana.e.nikolova@intel.com>
Mon, 12 Mar 2018 22:14:02 +0000 (17:14 -0500)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 26 Mar 2018 12:16:34 +0000 (09:16 -0300)
commit0dcd31084ea21c19735395aff09189dee9d4fdad
treee8002eff593706af4f3d5268b7463672398cada5
parentb04b608414f41953fb692e3f55a3d2c55e6fa668
RDMA/core: Do not use invalid destination in determining port reuse

BugLink: http://bugs.launchpad.net/bugs/1758886
commit 9dea9a2ff61c5efb4d4937ae23b14babd25a5547 upstream.

cma_port_is_unique() allows local port reuse if the quad (source
address and port, destination address and port) for this connection
is unique. However, if the destination info is zero or unspecified, it
can't make a correct decision but still allows port reuse. For example,
sometimes rdma_bind_addr() is called with unspecified destination and
reusing the port can lead to creating a connection with a duplicate quad,
after the destination is resolved. The issue manifests when MPI scale-up
tests hang after the duplicate quad is used.

Set the destination address family and add checks for zero destination
address and port to prevent source port reuse based on invalid destination.

Fixes: 19b752a19dce ("IB/cma: Allow port reuse for rdma_id")
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/infiniband/core/cma.c