linux/net/core
Mahesh Bandewar f357a79839 bonding: Fix bonding crash
[ Upstream commit 24b27fc4cd ]

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-30 10:18:36 +02:00
..
datagram.c
dev_addr_lists.c
dev_ioctl.c
dev.c bonding: Fix bonding crash 2016-09-30 10:18:36 +02:00
drop_monitor.c
dst.c
ethtool.c
fib_rules.c
filter.c
flow_dissector.c packet: Use symmetric hash for PACKET_FANOUT_HASH. 2016-07-27 09:47:31 -07:00
flow.c
gen_estimator.c
gen_stats.c
link_watch.c
lwtunnel.c
Makefile
neighbour.c
net_namespace.c
net-procfs.c
net-sysfs.c
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c
scm.c
secure_seq.c
skbuff.c net_sched: fix mirrored packets checksum 2016-07-27 09:47:31 -07:00
sock_diag.c
sock.c
stream.c
sysctl_net_core.c
timestamping.c
tso.c
utils.c