* [PATCH rdma-rc] RDMA/cma: Fix arguments order in net device validation
@ 2022-08-23 10:51 Leon Romanovsky
2022-08-29 8:17 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2022-08-23 10:51 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Michael Guralnik, linux-rdma
From: Michael Guralnik <michaelgur@nvidia.com>
Fix the order of source and destination addresses when resolving the
route between server and client to validate use of correct net device.
The reverse order we had so far didn't actually validate the net device
as the server would try to resolve the route to itself, thus always
getting the server's net device.
The issue was discovered when running cm applications on a single host
between 2 interfaces with same subnet and source based routing rules.
When resolving the reverse route the source based route rules were
ignored.
Fixes: f887f2ac87c2 ("IB/cma: Validate routing of incoming requests")
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
drivers/infiniband/core/cma.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index ee8f40b5ac99..81ded412a39e 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1841,8 +1841,8 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id,
}
if (!validate_net_dev(*net_dev,
- (struct sockaddr *)&req->listen_addr_storage,
- (struct sockaddr *)&req->src_addr_storage)) {
+ (struct sockaddr *)&req->src_addr_storage,
+ (struct sockaddr *)&req->listen_addr_storage)) {
id_priv = ERR_PTR(-EHOSTUNREACH);
goto err;
}
--
2.37.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH rdma-rc] RDMA/cma: Fix arguments order in net device validation
2022-08-23 10:51 [PATCH rdma-rc] RDMA/cma: Fix arguments order in net device validation Leon Romanovsky
@ 2022-08-29 8:17 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2022-08-29 8:17 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: Michael Guralnik, linux-rdma
On Tue, Aug 23, 2022 at 01:51:50PM +0300, Leon Romanovsky wrote:
> From: Michael Guralnik <michaelgur@nvidia.com>
>
> Fix the order of source and destination addresses when resolving the
> route between server and client to validate use of correct net device.
>
> The reverse order we had so far didn't actually validate the net device
> as the server would try to resolve the route to itself, thus always
> getting the server's net device.
>
> The issue was discovered when running cm applications on a single host
> between 2 interfaces with same subnet and source based routing rules.
> When resolving the reverse route the source based route rules were
> ignored.
>
> Fixes: f887f2ac87c2 ("IB/cma: Validate routing of incoming requests")
> Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
> drivers/infiniband/core/cma.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Thanks, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-29 8:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23 10:51 [PATCH rdma-rc] RDMA/cma: Fix arguments order in net device validation Leon Romanovsky
2022-08-29 8:17 ` Leon Romanovsky
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).