]> git.itanic.dy.fi Git - linux-stable/commit
RDMA/cma: Fix arguments order in net device validation
authorMichael Guralnik <michaelgur@nvidia.com>
Tue, 23 Aug 2022 10:51:50 +0000 (13:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:32:04 +0000 (11:32 +0200)
commite9ea271c2e43af02c9d9c876519c078b09beeb5c
tree4eec7e619483f702378b143eb55562a38714f452
parent465eecd2b3a40c488eca5f183add705cd827921e
RDMA/cma: Fix arguments order in net device validation

[ Upstream commit 27cfde795a96aef1e859a5480489944b95421e46 ]

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")
Link: https://lore.kernel.org/r/1c1ec2277a131d277ebcceec987fd338d35b775f.1661251872.git.leonro@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/cma.c