Skip to content

bonding: race and inconsistency fixes

Nikolay Aleksandrov netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesIn review
  2. v14 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bonding: fix set mode race conditionsdrivers/net/bonding/bond_sysfs.c+4 -00 replies
2/4bonding: replace %x with %pI4 for IPv4 addressesdrivers/net/bonding/bond_main.c+3 -30 replies
3/4bonding: arp_ip_count and arp_targets can be wrongdrivers/net/bonding/bond_main.c+8 -111 reply
4/4bonding: fix multiple 3ad mode sysfs race conditionsdrivers/net/bonding/bond_3ad.c drivers/net/bonding/bond_3ad.h drivers/net/bonding/bond_procfs.c +1 more+24 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] bonding: race and inconsistency fixes

Hello,
In patch 1/4 a race condition while changing the bonding mode through sysfs is fixed. Since no synchronization method is used it can race with different functions resulting in different impacts. RTNL is used to sync with the most important and dangerous events.
Patch 2/4 is trivial and improves the debugging output by changing %x format to %pI4 for IPv4 addresses in a few pr_debug() calls. Patch 3/4 fixes an inconsistent arp_targets state where we have 0 entry between (or in the beginning) the valid entries that were obtained which is hard to diagnose otherwise.
Patch 4/4 fixes multiple instances of a race condition which is because of calls to bond_3ad_get_active_agg_info without any locking, and since it traverses the slave list this can easily result in NULL ptr dereference or use of freed memory.

v2 is to address a minor style fix, to make the wrapper global and move it to bond_3ad.c, and also to fix the naming of the functions, all in patch 4/4.

Best regards,
Nikolay Aleksandrov

Nikolay Aleksandrov (4):
bonding: fix set mode race conditions
bonding: replace %x with %pI4 for IPv4 addresses
bonding: arp_ip_count and arp_targets can be wrong
bonding: fix multiple 3ad mode sysfs race conditions

 drivers/net/bonding/bond_3ad.c    | 21 +++++++++++++++++----
 drivers/net/bonding/bond_3ad.h    |  2 ++
 drivers/net/bonding/bond_main.c   | 25 +++++++++++--------------
 drivers/net/bonding/bond_procfs.c |  2 +-
 drivers/net/bonding/bond_sysfs.c  | 13 ++++++++-----
 5 files changed, 39 insertions(+), 24 deletions(-)
Signature · 1 line
1.8.1.4