• Jay Vosburgh's avatar
    bonding: Fix use after free in unregister path · 3201e656
    Jay Vosburgh authored
    	The following patch (based on a patch from Stephen Hemminger
    <shemminger@linux-foundation.org>) removes use after free conditions in
    the unregister path for the bonding master.  Without this patch, an
    operation of the form "echo -bond0 > /sys/class/net/bonding_masters"
    would trigger a NULL pointer dereference in sysfs.  I was not able to
    induce the failure with the non-sysfs code path, but for consistency I
    updated that code as well.
    
    	I also did some testing of the bonding /proc file being open
    while the bond is being deleted, and didn't see any problems there.
    Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    3201e656
bond_main.c 125 KB