bonding: Fix resource use after free
Subsystems (3)
PATCH 1/1 bonding: Fix resource use after free
Fix bond_destroy and bond_free_all to not reference the
struct net_device after calling unregister_netdevice.
Bug and offending change reported by Moni Shoua <[email protected]>
Signed-off-by Jay Vosburgh <[email protected]>
---
Copying DaveM since Jeff is out this week; please apply for 2.6.24. -J
drivers/net/bonding/bond_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +2 -2
@@ -1847,9 +1847,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)*/ void bond_destroy (struct bonding *bond) { -unregister_netdevice (bond->dev);bond_deinit (bond->dev);bond_destroy_sysfs_entry (bond); +unregister_netdevice (bond->dev); }/*
@@ -4475,8 +4475,8 @@ static void bond_free_all(void)bond_mc_list_destroy (bond);/* Release the bonded slaves */ bond_release_all (bond_dev); -unregister_netdevice (bond_dev);bond_deinit (bond_dev); +unregister_netdevice (bond_dev); }#ifdef CONFIG_PROC_FS
Signature · 1 line
1.5.3.1
From: Jay Vosburgh <[email protected]>
Date: Mon, 12 Nov 2007 18:15:36 -0800
Quoted 6 lines
Fix
bond_destroyandbond_free_allto not reference the
structnet_deviceafter callingunregister_netdevice.Bug and offending change reported by Moni Shoua <[email protected]>
Signed-off-by Jay Vosburgh <[email protected]>
Applied to net-2.6, thanks Jay.