android_kernel_lge_bullhead/drivers/net/bonding
Mahesh Bandewar 745db35452 bonding: Fix bonding crash
commit 24b27fc4cdf9e10c5e79e5923b6b7c2c5c95096c upstream.

Following few steps will crash kernel -

  (a) Create bonding master
      > modprobe bonding miimon=50
  (b) Create macvlan bridge on eth2
      > ip link add link eth2 dev mvl0 address aa:0:0:0:0:01 \
	   type macvlan
  (c) Now try adding eth2 into the bond
      > echo +eth2 > /sys/class/net/bond0/bonding/slaves
      <crash>

Bonding does lots of things before checking if the device enslaved is
busy or not.

In this case when the notifier call-chain sends notifications, the
bond_netdev_event() assumes that the rx_handler /rx_handler_data is
registered while the bond_enslave() hasn't progressed far enough to
register rx_handler for the new slave.

This patch adds a rx_handler check that can be performed right at the
beginning of the enslave code to avoid getting into this situation.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-02-10 11:03:47 +01:00
..
Makefile bonding, ipv4, ipv6, vlan: Handle NETDEV_BONDING_FAILOVER like NETDEV_NOTIFY_PEERS 2011-04-17 23:36:03 -07:00
bond_3ad.c bonding: 802.3ad: make aggregator_identifier bond-private 2014-03-06 21:30:04 -08:00
bond_3ad.h bonding: 802.3ad: make aggregator_identifier bond-private 2014-03-06 21:30:04 -08:00
bond_alb.c net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
bond_alb.h bonding: delete migrated IP addresses from the rlb hash table 2012-11-30 12:07:27 -05:00
bond_debugfs.c bonding: delete migrated IP addresses from the rlb hash table 2012-11-30 12:07:27 -05:00
bond_main.c bonding: Fix bonding crash 2017-02-10 11:03:47 +01:00
bond_procfs.c bonding: fix multiple 3ad mode sysfs race conditions 2013-05-19 23:25:49 -07:00
bond_sysfs.c bonding: fix two race conditions in bond_store_updelay/downdelay 2013-12-08 07:29:24 -08:00
bonding.h bonding: fix igmp_retrans type and two related races 2013-06-13 02:33:37 -07:00