Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8cbdeec637c1ce87bf329c5c19a9964e36bdf9fb
Commit:     8cbdeec637c1ce87bf329c5c19a9964e36bdf9fb
Parent:     ce1d18e0064d55106a7042c07cfca97cad66f407
Author:     Jay Vosburgh <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 13 21:16:29 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Nov 13 21:16:29 2007 -0800

    [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]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a198404..423298c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to