Commit 379ca2da authored by Håkon Bugge's avatar Håkon Bugge Committed by openeuler-sync-bot
Browse files

RDMA/cma: Use output interface for net_dev check

stable inclusion
from stable-v5.10.154
commit 87ac93c8dd6ddbbfa2c2239a42520c8410d2fcca
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=87ac93c8dd6ddbbfa2c2239a42520c8410d2fcca



--------------------------------

[ Upstream commit eb83f502 ]

Commit 27cfde79 ("RDMA/cma: Fix arguments order in net device
validation") swapped the src and dst addresses in the call to
validate_net_dev().

As a consequence, the test in validate_ipv4_net_dev() to see if the
net_dev is the right one, is incorrect for port 1 <-> 2 communication when
the ports are on the same sub-net. This is fixed by denoting the
flowi4_oif as the device instead of the incoming one.

The bug has not been observed using IPv6 addresses.

Fixes: 27cfde79 ("RDMA/cma: Fix arguments order in net device validation")
Signed-off-by: default avatarHåkon Bugge <haakon.bugge@oracle.com>
Link: https://lore.kernel.org/r/20221012141542.16925-1-haakon.bugge@oracle.com


Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
(cherry picked from commit 8fe6b49f)
parent 26babc19
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment