Skip to content

Commit 27cfde7

Browse files
mikijoyrleon
authored andcommitted
RDMA/cma: Fix arguments order in net device validation
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: f887f2a ("IB/cma: Validate routing of incoming requests") Link: https://lore.kernel.org/r/1c1ec2277a131d277ebcceec987fd338d35b775f.1661251872.git.leonro@nvidia.com Signed-off-by: Michael Guralnik <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent ead54ce commit 27cfde7

File tree

1 file changed

+2
-2
lines changed
  • drivers/infiniband/core

1 file changed

+2
-2
lines changed

drivers/infiniband/core/cma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,8 +1841,8 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id,
18411841
}
18421842

18431843
if (!validate_net_dev(*net_dev,
1844-
(struct sockaddr *)&req->listen_addr_storage,
1845-
(struct sockaddr *)&req->src_addr_storage)) {
1844+
(struct sockaddr *)&req->src_addr_storage,
1845+
(struct sockaddr *)&req->listen_addr_storage)) {
18461846
id_priv = ERR_PTR(-EHOSTUNREACH);
18471847
goto err;
18481848
}

0 commit comments

Comments
 (0)