Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/ucma: Allow resolving address w/o specifying source address

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>

authored by

Roland Dreier and committed by
Doug Ledford
09abfe7b 8b77586b

+1 -1
+1 -1
drivers/infiniband/core/ucma.c
··· 700 700 if (copy_from_user(&cmd, inbuf, sizeof(cmd))) 701 701 return -EFAULT; 702 702 703 - if (!rdma_addr_size_in6(&cmd.src_addr) || 703 + if ((cmd.src_addr.sin6_family && !rdma_addr_size_in6(&cmd.src_addr)) || 704 704 !rdma_addr_size_in6(&cmd.dst_addr)) 705 705 return -EINVAL; 706 706