[openib-general] [PATCH] ipoib: protect child list access
Michael S. Tsirkin
mst at mellanox.co.il
Thu Nov 17 07:52:09 PST 2005
race condition: ipoib_ib_dev_flush is accessing child list without locks.
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: linux-2.6.14-dbg/drivers/infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- linux-2.6.14-dbg/drivers/infiniband/ulp/ipoib/ipoib_ib.c (revision 4042)
+++ linux-2.6.14-dbg/drivers/infiniband/ulp/ipoib/ipoib_ib.c (working copy)
@@ -608,9 +608,13 @@ void ipoib_ib_dev_flush(void *_dev)
if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
ipoib_ib_dev_up(dev);
+ down(&priv->vlan_mutex);
+
/* Flush any child interfaces too */
list_for_each_entry(cpriv, &priv->child_intfs, list)
ipoib_ib_dev_flush(&cpriv->dev);
+
+ up(&priv->vlan_mutex);
}
void ipoib_ib_dev_cleanup(struct net_device *dev)
--
MST
More information about the general
mailing list