Skip to content

Commit 3ae1bf3

Browse files
rolanddgregkh
authored andcommitted
RDMA/ucma: Allow resolving address w/o specifying source address
commit 09abfe7 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: 2975d5d ("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>
1 parent 38a65e7 commit 3ae1bf3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/infiniband/core/ucma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ static ssize_t ucma_resolve_ip(struct ucma_file *file,
678678
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
679679
return -EFAULT;
680680

681-
if (!rdma_addr_size_in6(&cmd.src_addr) ||
681+
if ((cmd.src_addr.sin6_family && !rdma_addr_size_in6(&cmd.src_addr)) ||
682682
!rdma_addr_size_in6(&cmd.dst_addr))
683683
return -EINVAL;
684684

0 commit comments

Comments
 (0)