mbox series

[PATCHv3,net,0/4] bonding: fix send_peer_notif overflow

Message ID 20230509031200.2152236-1-liuhangbin@gmail.com (mailing list archive)
Headers show
Series bonding: fix send_peer_notif overflow | expand

Message

Hangbin Liu May 9, 2023, 3:11 a.m. UTC
Bonding send_peer_notif was defined as u8. But the value is
num_peer_notif multiplied by peer_notif_delay, which is u8 * u32.
This would cause the send_peer_notif overflow.

Before the fix:
TEST: num_grat_arp (active-backup miimon num_grat_arp 10)           [ OK ]
TEST: num_grat_arp (active-backup miimon num_grat_arp 20)           [ OK ]
4 garp packets sent on active slave eth1
TEST: num_grat_arp (active-backup miimon num_grat_arp 30)           [FAIL]
24 garp packets sent on active slave eth1
TEST: num_grat_arp (active-backup miimon num_grat_arp 50)           [FAIL]

After the fix:
TEST: num_grat_arp (active-backup miimon num_grat_arp 10)           [ OK ]
TEST: num_grat_arp (active-backup miimon num_grat_arp 20)           [ OK ]
TEST: num_grat_arp (active-backup miimon num_grat_arp 30)           [ OK ]
TEST: num_grat_arp (active-backup miimon num_grat_arp 50)           [ OK ]

Hangbin Liu (4):
  bonding: fix send_peer_notif overflow
  Documentation: bonding: fix the doc of peer_notif_delay
  selftests: forwarding: lib: add netns support for tc rule handle stats
    get
  kselftest: bonding: add num_grat_arp test

 Documentation/networking/bonding.rst          |  9 ++--
 drivers/net/bonding/bond_netlink.c            |  7 ++-
 drivers/net/bonding/bond_options.c            |  8 ++-
 include/net/bonding.h                         |  2 +-
 .../drivers/net/bonding/bond_options.sh       | 50 +++++++++++++++++++
 .../drivers/net/bonding/bond_topo_3d1c.sh     |  2 +
 tools/testing/selftests/net/forwarding/lib.sh |  3 +-
 7 files changed, 73 insertions(+), 8 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 10, 2023, 8:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue,  9 May 2023 11:11:56 +0800 you wrote:
> Bonding send_peer_notif was defined as u8. But the value is
> num_peer_notif multiplied by peer_notif_delay, which is u8 * u32.
> This would cause the send_peer_notif overflow.
> 
> Before the fix:
> TEST: num_grat_arp (active-backup miimon num_grat_arp 10)           [ OK ]
> TEST: num_grat_arp (active-backup miimon num_grat_arp 20)           [ OK ]
> 4 garp packets sent on active slave eth1
> TEST: num_grat_arp (active-backup miimon num_grat_arp 30)           [FAIL]
> 24 garp packets sent on active slave eth1
> TEST: num_grat_arp (active-backup miimon num_grat_arp 50)           [FAIL]
> 
> [...]

Here is the summary with links:
  - [PATCHv3,net,1/4] bonding: fix send_peer_notif overflow
    https://git.kernel.org/netdev/net/c/9949e2efb54e
  - [PATCHv3,net,2/4] Documentation: bonding: fix the doc of peer_notif_delay
    https://git.kernel.org/netdev/net/c/84df83e0ecd3
  - [PATCHv3,net,3/4] selftests: forwarding: lib: add netns support for tc rule handle stats get
    https://git.kernel.org/netdev/net/c/b6d1599f8c28
  - [PATCHv3,net,4/4] kselftest: bonding: add num_grat_arp test
    https://git.kernel.org/netdev/net/c/6cbe791c0f4e

You are awesome, thank you!