From: Hangbin Liu Date: Mon, 12 Dec 2022 03:56:45 +0000 (+0800) Subject: bonding: add missed __rcu annotation for curr_active_slave X-Git-Tag: v6.0.16~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a7afdbc814b30a5404a2ef2a434b553685a4982;p=thirdparty%2Fkernel%2Fstable.git bonding: add missed __rcu annotation for curr_active_slave [ Upstream commit 3d0b738fc5adf9f380702ac1424672e4b32c3781 ] 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 Signed-off-by: Jakub Kicinski Stable-dep-of: e95cc44763a4 ("bonding: do failover when high prio link up") Signed-off-by: Sasha Levin --- diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 445c23e424f7a..36a8db1403886 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2698,7 +2698,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;