Patch "bonding: fix lockdep splat in bond_miimon_commit()" 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

    bonding: fix lockdep splat in bond_miimon_commit()

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:
     bonding-fix-lockdep-splat-in-bond_miimon_commit.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 eca1f7f4b831191b4a0667b62b064d045e27f01f
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date:   Tue Dec 20 13:08:31 2022 +0000

    bonding: fix lockdep splat in bond_miimon_commit()
    
    [ Upstream commit 42c7ded0eeacd2ba5db599205c71c279dc715de7 ]
    
    bond_miimon_commit() is run while RTNL is held, not RCU.
    
    WARNING: suspicious RCU usage
    6.1.0-syzkaller-09671-g89529367293c #0 Not tainted
    -----------------------------
    drivers/net/bonding/bond_main.c:2704 suspicious rcu_dereference_check() usage!
    
    Fixes: e95cc44763a4 ("bonding: do failover when high prio link up")
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Reported-by: syzbot <syzkaller@xxxxxxxxxxxxxxxx>
    Cc: Hangbin Liu <liuhangbin@xxxxxxxxx>
    Cc: Jay Vosburgh <j.vosburgh@xxxxxxxxx>
    Cc: Veaceslav Falico <vfalico@xxxxxxxxx>
    Cc: Andy Gospodarek <andy@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221220130831.1480888-1-edumazet@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 771f2a533d3f..7807113e0910 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2653,10 +2653,12 @@ static void bond_miimon_link_change(struct bonding *bond,
 
 static void bond_miimon_commit(struct bonding *bond)
 {
-	struct slave *slave, *primary;
+	struct slave *slave, *primary, *active;
 	bool do_failover = false;
 	struct list_head *iter;
 
+	ASSERT_RTNL();
+
 	bond_for_each_slave(bond, slave, iter) {
 		switch (slave->link_new_state) {
 		case BOND_LINK_NOCHANGE:
@@ -2699,8 +2701,8 @@ static void bond_miimon_commit(struct bonding *bond)
 
 			bond_miimon_link_change(bond, slave, BOND_LINK_UP);
 
-			if (!rcu_access_pointer(bond->curr_active_slave) || slave == primary ||
-			    slave->prio > rcu_dereference(bond->curr_active_slave)->prio)
+			active = rtnl_dereference(bond->curr_active_slave);
+			if (!active || slave == primary || slave->prio > active->prio)
 				do_failover = true;
 
 			continue;



[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