aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sun/sunvnet.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-07-22 01:46:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-07-22 01:46:01 -0400
commit15ba2236f3556fc01b9ca91394465152b5ea74b6 (patch)
treed272d8227f618aab5e63075a8aa86932f3c89e50 /drivers/net/ethernet/sun/sunvnet.c
parent89faa06ec4229b27e339891df69b4d92f29ab899 (diff)
parent850717ef00d8a224cf1aaffc9c636ea67e01cce2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Null termination fix in dns_resolver got the pointer dereferncing wrong, fix from Ben Hutchings. 2) ip_options_compile() has a benign but real buffer overflow when parsing options. From Eric Dumazet. 3) Table updates can crash in netfilter's nftables if none of the state flags indicate an actual change, from Pablo Neira Ayuso. 4) Fix race in nf_tables dumping, also from Pablo. 5) GRE-GRO support broke the forwarding path because the segmentation state was not fully initialized in these paths, from Jerry Chu. 6) sunvnet driver leaks objects and potentially crashes on module unload, from Sowmini Varadhan. 7) We can accidently generate the same handle for several u32 classifier filters, fix from Cong Wang. 8) Several edge case bug fixes in fragment handling in xen-netback, from Zoltan Kiss. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits) ipv4: fix buffer overflow in ip_options_compile() batman-adv: fix TT VLAN inconsistency on VLAN re-add batman-adv: drop QinQ claim frames in bridge loop avoidance dns_resolver: Null-terminate the right string xen-netback: Fix pointer incrementation to avoid incorrect logging xen-netback: Fix releasing header slot on error path xen-netback: Fix releasing frag_list skbs in error path xen-netback: Fix handling frag_list on grant op error path net_sched: avoid generating same handle for u32 filters net: huawei_cdc_ncm: add "subclass 3" devices net: qmi_wwan: add two Sierra Wireless/Netgear devices wan/x25_asy: integer overflow in x25_asy_change_mtu() net: ppp: fix creating PPP pass and active filters net/mlx4_en: cq->irq_desc wasn't set in legacy EQ's sunvnet: clean up objects created in vnet_new() on vnet_exit() r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40 net-gre-gro: Fix a bug that breaks the forwarding path netfilter: nf_tables: 64bit stats need some extra synchronization netfilter: nf_tables: set NLM_F_DUMP_INTR if netlink dumping is stale netfilter: nf_tables: safe RCU iteration on list when dumping ...
Diffstat (limited to 'drivers/net/ethernet/sun/sunvnet.c')
-rw-r--r--drivers/net/ethernet/sun/sunvnet.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c
index 1c24a8f368bd..fd411d6e19a2 100644
--- a/drivers/net/ethernet/sun/sunvnet.c
+++ b/drivers/net/ethernet/sun/sunvnet.c
@@ -1083,6 +1083,24 @@ static struct vnet *vnet_find_or_create(const u64 *local_mac)
1083 return vp; 1083 return vp;
1084} 1084}
1085 1085
1086static void vnet_cleanup(void)
1087{
1088 struct vnet *vp;
1089 struct net_device *dev;
1090
1091 mutex_lock(&vnet_list_mutex);
1092 while (!list_empty(&vnet_list)) {
1093 vp = list_first_entry(&vnet_list, struct vnet, list);
1094 list_del(&vp->list);
1095 dev = vp->dev;
1096 /* vio_unregister_driver() should have cleaned up port_list */
1097 BUG_ON(!list_empty(&vp->port_list));
1098 unregister_netdev(dev);
1099 free_netdev(dev);
1100 }
1101 mutex_unlock(&vnet_list_mutex);
1102}
1103
1086static const char *local_mac_prop = "local-mac-address"; 1104static const char *local_mac_prop = "local-mac-address";
1087 1105
1088static struct vnet *vnet_find_parent(struct mdesc_handle *hp, 1106static struct vnet *vnet_find_parent(struct mdesc_handle *hp,
@@ -1240,7 +1258,6 @@ static int vnet_port_remove(struct vio_dev *vdev)
1240 1258
1241 kfree(port); 1259 kfree(port);
1242 1260
1243 unregister_netdev(vp->dev);
1244 } 1261 }
1245 return 0; 1262 return 0;
1246} 1263}
@@ -1268,6 +1285,7 @@ static int __init vnet_init(void)
1268static void __exit vnet_exit(void) 1285static void __exit vnet_exit(void)
1269{ 1286{
1270 vio_unregister_driver(&vnet_port_driver); 1287 vio_unregister_driver(&vnet_port_driver);
1288 vnet_cleanup();
1271} 1289}
1272 1290
1273module_init(vnet_init); 1291module_init(vnet_init);