]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bonding: fix event handling for stacked bonds
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 12 Apr 2019 13:04:10 +0000 (15:04 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit02c2c3e463e018e43ecdafc4b09f1cb8ce685597
tree5ed602c98adbe3d7c42efe7e02e96249ad3f92f0
parentf2ef2d83a6cc61d4debb55895b744108aa9049a3
bonding: fix event handling for stacked bonds

BugLink: https://bugs.launchpad.net/bugs/1838349
[ Upstream commit 92480b3977fd3884649d404cbbaf839b70035699 ]

When a bond is enslaved to another bond, bond_netdev_event() only
handles the event as if the bond is a master, and skips treating the
bond as a slave.

This leads to a refcount leak on the slave, since we don't remove the
adjacency to its master and the master holds a reference on the slave.

Reproducer:
  ip link add bondL type bond
  ip link add bondU type bond
  ip link set bondL master bondU
  ip link del bondL

No "Fixes:" tag, this code is older than git history.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/bonding/bond_main.c