* [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check
@ 2022-10-12 14:15 Håkon Bugge
2022-10-13 8:43 ` Leon Romanovsky
0 siblings, 1 reply; 4+ messages in thread
From: Håkon Bugge @ 2022-10-12 14:15 UTC (permalink / raw)
To: Jason Gunthorpe, Michael Guralnik, Leon Romanovsky; +Cc: linux-rdma
Commit 27cfde795a96 ("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: 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation")
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
---
drivers/infiniband/core/cma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 925e1e7d1f1f3..2f95e12296fa2 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1634,7 +1634,7 @@ static bool validate_ipv4_net_dev(struct net_device *net_dev,
return false;
memset(&fl4, 0, sizeof(fl4));
- fl4.flowi4_iif = net_dev->ifindex;
+ fl4.flowi4_oif = net_dev->ifindex;
fl4.daddr = daddr;
fl4.saddr = saddr;
--
2.16.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check
2022-10-12 14:15 [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check Håkon Bugge
@ 2022-10-13 8:43 ` Leon Romanovsky
2022-10-13 10:31 ` Haakon Bugge
0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2022-10-13 8:43 UTC (permalink / raw)
To: Håkon Bugge; +Cc: Jason Gunthorpe, Michael Guralnik, linux-rdma
On Wed, Oct 12, 2022 at 04:15:42PM +0200, Håkon Bugge wrote:
> Commit 27cfde795a96 ("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: 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation")
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> ---
> drivers/infiniband/core/cma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check
2022-10-13 8:43 ` Leon Romanovsky
@ 2022-10-13 10:31 ` Haakon Bugge
2022-10-13 10:49 ` Leon Romanovsky
0 siblings, 1 reply; 4+ messages in thread
From: Haakon Bugge @ 2022-10-13 10:31 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: Jason Gunthorpe, Michael Guralnik, OFED mailing list
> On 13 Oct 2022, at 10:43, Leon Romanovsky <leon@kernel.org> wrote:
>
> On Wed, Oct 12, 2022 at 04:15:42PM +0200, Håkon Bugge wrote:
>> Commit 27cfde795a96 ("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: 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation")
>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
>> ---
>> drivers/infiniband/core/cma.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Thank you for your quick review Leon!
Håkon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check
2022-10-13 10:31 ` Haakon Bugge
@ 2022-10-13 10:49 ` Leon Romanovsky
0 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2022-10-13 10:49 UTC (permalink / raw)
To: Haakon Bugge; +Cc: Jason Gunthorpe, Michael Guralnik, OFED mailing list
On Thu, Oct 13, 2022 at 10:31:55AM +0000, Haakon Bugge wrote:
>
>
> > On 13 Oct 2022, at 10:43, Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Wed, Oct 12, 2022 at 04:15:42PM +0200, Håkon Bugge wrote:
> >> Commit 27cfde795a96 ("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: 27cfde795a96 ("RDMA/cma: Fix arguments order in net device validation")
> >> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> >> ---
> >> drivers/infiniband/core/cma.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >
> > Thanks,
> > Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
>
> Thank you for your quick review Leon!
Sure, just as a note. We won't take any patches before -rc1.
Thanks
>
>
> Håkon
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-13 10:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 14:15 [PATCH rdma-rc] RDMA/cma: Use output interface for net_dev check Håkon Bugge
2022-10-13 8:43 ` Leon Romanovsky
2022-10-13 10:31 ` Haakon Bugge
2022-10-13 10:49 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox