RDMA/ucma: Allow resolving address w/o specifying source address
authorRoland Dreier <roland@purestorage.com>
Thu, 19 Apr 2018 15:28:11 +0000 (08:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 May 2018 07:51:52 +0000 (09:51 +0200)
commit3ae1bf3681352fc8c08cbd3be2d210f59d4cc42a
treee3638120f21422b1bd8d2d0631cc4c114241a48d
parent38a65e7535031abbf796e2c645431bf7998d4084
RDMA/ucma: Allow resolving address w/o specifying source address

commit 09abfe7b5b2f442a85f4c4d59ecf582ad76088d7 upstream.

The RDMA CM will select a source device and address by consulting
the routing table if no source address is passed into
rdma_resolve_address().  Userspace will ask for this by passing an
all-zero source address in the RESOLVE_IP command.  Unfortunately
the new check for non-zero address size rejects this with EINVAL,
which breaks valid userspace applications.

Fix this by explicitly allowing a zero address family for the source.

Fixes: 2975d5de6428 ("RDMA/ucma: Check AF family prior resolving address")
Cc: <stable@vger.kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/core/ucma.c