Commit 2deff697 authored by Loic Prylli's avatar Loic Prylli Committed by Kamal Mostafa

net: Fix NETDEV_CHANGE notifier usage causing spurious arp flush

[ Upstream commit 54951194 ]

A bug was introduced in NETDEV_CHANGE notifier sequence causing the
arp table to be sometimes spuriously cleared (including manual arp
entries marked permanent), upon network link carrier changes.

The changed argument for the notifier was applied only to a single
caller of NETDEV_CHANGE, missing among others netdev_state_change().
So upon net_carrier events induced by the network, which are
triggering a call to netdev_state_change(), arp_netdev_event() would
decide whether to clear or not arp cache based on random/junk stack
values (a kind of read buffer overflow).

Fixes: be9efd36 ("net: pass changed flags along with NETDEV_CHANGE event")
Fixes: 6c8b4e3f ("arp: flush arp cache on IFF_NOARP change")
Signed-off-by: default avatarLoic Prylli <loicp@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[ kamal: backport to 3.13-stable from David's 3.14 port
 (call_netdevice_notifiers_info is not static) ]
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 15f4f9f3
......@@ -1203,7 +1203,11 @@ EXPORT_SYMBOL(netdev_features_change);
void netdev_state_change(struct net_device *dev)
{
if (dev->flags & IFF_UP) {
call_netdevice_notifiers(NETDEV_CHANGE, dev);
struct netdev_notifier_change_info change_info;
change_info.flags_changed = 0;
call_netdevice_notifiers_info(NETDEV_CHANGE, dev,
&change_info.info);
rtmsg_ifinfo(RTM_NEWLINK, dev, 0, GFP_KERNEL);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment