linux-stable/drivers/net
Neil Horman 5a0068deb6 bonding: Fix broken promiscuity reference counting issue
Recently grabbed this report:
https://bugzilla.redhat.com/show_bug.cgi?id=1005567

Of an issue in which the bonding driver, with an attached vlan encountered the
following errors when bond0 was taken down and back up:

dummy1: promiscuity touches roof, set promiscuity failed. promiscuity feature of
device might be broken.

The error occurs because, during __bond_release_one, if we release our last
slave, we take on a random mac address and issue a NETDEV_CHANGEADDR
notification.  With an attached vlan, the vlan may see that the vlan and bond
mac address were in sync, but no longer are.  This triggers a call to dev_uc_add
and dev_set_rx_mode, which enables IFF_PROMISC on the bond device.  Then, when
we complete __bond_release_one, we use the current state of the bond flags to
determine if we should decrement the promiscuity of the releasing slave.  But
since the bond changed promiscuity state during the release operation, we
incorrectly decrement the slave promisc count when it wasn't in promiscuous mode
to begin with, causing the above error

Fix is pretty simple, just cache the bonding flags at the start of the function
and use those when determining the need to set promiscuity.

This is also needed for the ALLMULTI flag

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Mark Wu <wudxw@linux.vnet.ibm.com>
CC: "David S. Miller" <davem@davemloft.net>
Reported-by: Mark Wu <wudxw@linux.vnet.ibm.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-30 21:10:55 -07:00
..
appletalk PTR_RET is now PTR_ERR_OR_ZERO(): Replace most. 2013-07-15 11:25:01 +09:30
arcnet arcnet: cleanup sizeof parameter 2013-07-19 17:36:03 -07:00
bonding bonding: Fix broken promiscuity reference counting issue 2013-09-30 21:10:55 -07:00
caif caif: add a sanity check to the tty name 2013-09-04 00:27:27 -04:00
can Merge branch 'fixes-for-3.12' of git://gitorious.org/linux-can/linux-can 2013-09-27 02:08:03 -04:00
cris
dsa
ethernet powerpc/83xx: gianfar_ptp: select 1588 clock source through dts file 2013-09-30 14:49:47 -04:00
fddi drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent 2013-08-29 21:55:23 -04:00
hamradio
hippi
hyperv Drivers: hv: remove HV_DRV_VERSION 2013-08-02 11:34:30 +08:00
ieee802154
irda net/irda/mcs7780: fix memory leaks in mcs_net_open() 2013-09-12 23:43:56 -04:00
phy drivers: net: phy: cicada.c: clears warning Use #include <linux/io.h> instead of <asm/io.h> 2013-09-17 19:07:00 -04:00
plip
ppp ip: generate unique IP identificator if local fragmentation is allowed 2013-09-19 14:11:15 -04:00
slip slip/slcan: added locking in wakeup function 2013-09-20 15:38:26 -04:00
team net: team: inherit addr_assign_type along with dev_addr 2013-09-03 20:57:49 -04:00
usb dm9601: fix IFF_ALLMULTI handling 2013-09-30 19:48:59 -04:00
vmxnet3 VMXNET3: Add support for virtual IOMMU 2013-08-27 16:02:02 -04:00
wan net: wan: sbni: Fix incorrect placement of __initdata 2013-08-09 13:24:26 -07:00
wimax
wireless brcmsmac: call bcma_core_pci_power_save() from non-atomic context 2013-09-26 14:02:34 -04:00
xen-netback xen-netback: Handle backend state transitions in a more robust way 2013-09-30 15:13:28 -04:00
dummy.c
eql.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c net loopback: Set loopback_dev to NULL when freed 2013-09-17 19:05:13 -04:00
macvlan.c macvlan: Move skb_clone check closer to call 2013-09-11 16:03:12 -04:00
macvtap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-08-26 16:37:08 -04:00
Makefile
mdio.c
mii.c
netconsole.c netconsole: fix a deadlock with rtnl and netconsole's mutex 2013-09-19 14:15:53 -04:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c tuntap: correctly handle error in tun_set_iff() 2013-09-12 17:21:42 -04:00
veth.c veth: add vlan features 2013-07-19 17:36:03 -07:00
virtio_net.c virtio-net: Set RXCSUM feature if GUEST_CSUM is available 2013-09-03 21:36:41 -04:00
vxlan.c vxlan: Use RCU apis to access sk_user_data. 2013-09-30 14:22:59 -04:00
xen-netfront.c xen-netfront: pull on receive skb may need to happen earlier 2013-07-17 12:51:19 -07:00