* [PATCH] RDMA/ucma: Allow resolving address without specifying source address
@ 2018-04-19 15:28 Roland Dreier
2018-04-20 2:09 ` Doug Ledford
0 siblings, 1 reply; 2+ messages in thread
From: Roland Dreier @ 2018-04-19 15:28 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe, Leon Romanovsky
Cc: linux-rdma, Roland Dreier, stable
From: Roland Dreier <roland@purestorage.com>
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>
---
drivers/infiniband/core/ucma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 74329483af6d..0a7242ce7c1f 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -683,7 +683,7 @@ static ssize_t ucma_resolve_ip(struct ucma_file *file,
if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
return -EFAULT;
- if (!rdma_addr_size_in6(&cmd.src_addr) ||
+ if ((cmd.src_addr.sin6_family && !rdma_addr_size_in6(&cmd.src_addr)) ||
!rdma_addr_size_in6(&cmd.dst_addr))
return -EINVAL;
--
2.17.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] RDMA/ucma: Allow resolving address without specifying source address
2018-04-19 15:28 [PATCH] RDMA/ucma: Allow resolving address without specifying source address Roland Dreier
@ 2018-04-20 2:09 ` Doug Ledford
0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2018-04-20 2:09 UTC (permalink / raw)
To: Roland Dreier, Jason Gunthorpe, Leon Romanovsky
Cc: linux-rdma, Roland Dreier, stable
[-- Attachment #1: Type: text/plain, Size: 912 bytes --]
On Thu, 2018-04-19 at 08:28 -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
>
> 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>
Thanks, applied to for-rc.
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-04-20 2:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-19 15:28 [PATCH] RDMA/ucma: Allow resolving address without specifying source address Roland Dreier
2018-04-20 2:09 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).