]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bonding: annotate data-races arcound churn variables
authorEric Dumazet <edumazet@google.com>
Wed, 3 Jun 2026 12:35:14 +0000 (12:35 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jun 2026 15:58:18 +0000 (08:58 -0700)
commitb47ff80f280e18ad2310f44293cc057d9b64ff11
treee9752f48578ae1b7513ea5a1f43607b6e525b7bc
parent7561c7fbc694308da73300f036719e63e42bf0b4
bonding: annotate data-races arcound churn variables

These fields are updated asynchronously by the bonding state machine
in ad_churn_machine() while holding bond->mode_lock.

bond_info_show_slave() and bond_fill_slave_info() read them without
bond->mode_lock being held, we need to add READ_ONCE() and
WRITE_ONCE() annotations.

Note that AD_CHURN_MONITOR, AD_CHURN, and AD_NO_CHURN are defined
exclusively in (kernel private) include/net/bond_3ad.h header.

They should be moved to include/uapi/linux/if_bonding.h or userspace
tools will have to hardcode their values.

Fixes: 4916f2e2f3fc ("bonding: print churn state via netlink")
Fixes: 14c9551a32eb ("bonding: Implement port churn-machine (AD standard 43.4.17).")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260603123514.388226-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bonding/bond_3ad.c
drivers/net/bonding/bond_netlink.c
drivers/net/bonding/bond_procfs.c