• Jason Gunthorpe's avatar
    IB/ipoib: Maintain the child_intfs list from ndo_init/uninit · 13476d35
    Jason Gunthorpe authored
    This fixes a bug in the netlink path where the vlan_rwsem was not
    held around __ipoib_vlan_add causing the child_intfs to be manipulated
    unsafely.
    
    In the process this greatly simplifies the vlan_rwsem write side locking
    to only cover a single non-sleeping statement.
    
    This also further increases the safety of the removal ordering by holding
    the netdev of the parent while the child is active to ensure most bugs
    become either an oops on a NULL priv or a deadlock on the netdev refcount.
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
    13476d35
ipoib_vlan.c 6.63 KB