linux/drivers/net/bonding
Tonghao Zhang 10843e1492 net: bonding: fix possible peer notify event loss or dup issue
If the send_peer_notif counter and the peer event notify are not synchronized.
It may cause problems such as the loss or dup of peer notify event.

Before this patch:
- If should_notify_peers is true and the lock for send_peer_notif-- fails, peer
  event may be sent again in next mii_monitor loop, because should_notify_peers
  is still true.
- If should_notify_peers is true and the lock for send_peer_notif-- succeeded,
  but the lock for peer event fails, the peer event will be lost.

This patch locks the RTNL for send_peer_notif, events, and commit simultaneously.

Fixes: 07a4ddec3c ("bonding: add an option to specify a delay between peer notifications")
Cc: Jay Vosburgh <jv@jvosburgh.net>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Hangbin Liu <liuhangbin@gmail.com>
Cc: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Vincent Bernat <vincent@bernat.ch>
Cc: <stable@vger.kernel.org>
Signed-off-by: Tonghao Zhang <tonghao@bamaicloud.com>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20251021050933.46412-1-tonghao@bamaicloud.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2025-10-23 13:08:53 +02:00
..
bond_3ad.c bonding: support aggregator selection based on port priority 2025-09-09 10:56:02 +02:00
bond_alb.c net: core: Convert dev_set_mac_address() to struct sockaddr_storage 2025-05-27 08:25:43 +02:00
bond_debugfs.c saner replacement for debugfs_rename() 2025-01-15 13:14:37 +01:00
bond_main.c net: bonding: fix possible peer notify event loss or dup issue 2025-10-23 13:08:53 +02:00
bond_netlink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-01 10:14:49 +02:00
bond_options.c bonding: fix standard reference typo in ad_select description 2025-09-15 18:12:35 -07:00
bond_procfs.c bonding: no longer use RTNL in bonding_show_queue_id() 2024-04-09 17:31:45 -07:00
bond_sysfs.c bonding: Remove support for use_carrier 2025-09-02 14:01:54 -07:00
bond_sysfs_slave.c bonding: no longer use RTNL in bonding_show_queue_id() 2024-04-09 17:31:45 -07:00
bonding_priv.h net: bonding: Add SPDX identifier to remaining files 2023-05-16 15:38:06 +02:00
Makefile