Patch "RDMA/cma: Use output interface for net_dev check" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/cma: Use output interface for net_dev check

to the 6.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-cma-use-output-interface-for-net_dev-check.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 034930e6e39abdbb8bfaafbf61a8784ee8888378
Author: Håkon Bugge <haakon.bugge@xxxxxxxxxx>
Date:   Wed Oct 12 16:15:42 2022 +0200

    RDMA/cma: Use output interface for net_dev check
    
    [ Upstream commit eb83f502adb036cd56c27e13b9ca3b2aabfa790b ]
    
    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@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221012141542.16925-1-haakon.bugge@xxxxxxxxxx
    Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index be317f2665a9..ff8821f79fec 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1556,7 +1556,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;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux