]> git.itanic.dy.fi Git - linux-stable/commitdiff
bonding: add missed __rcu annotation for curr_active_slave
authorHangbin Liu <liuhangbin@gmail.com>
Mon, 12 Dec 2022 03:56:45 +0000 (11:56 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Dec 2022 03:19:32 +0000 (19:19 -0800)
There is one direct accesses to bond->curr_active_slave in
bond_miimon_commit(). Protected it by rcu_access_pointer()
since the later of this function also use this one.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bonding/bond_main.c

index f7767afe116b33266de506d0728b3e04f17ee57c..6a4bbd5aa3e0951e05990be6cce6950221c812bc 100644 (file)
@@ -2699,7 +2699,7 @@ static void bond_miimon_commit(struct bonding *bond)
 
                        bond_miimon_link_change(bond, slave, BOND_LINK_UP);
 
-                       if (!bond->curr_active_slave || slave == primary)
+                       if (!rcu_access_pointer(bond->curr_active_slave) || slave == primary)
                                goto do_failover;
 
                        continue;