[openib-general] [PATCH] ipoib: protect mc_list access

Michael S. Tsirkin mst at mellanox.co.il
Mon Jan 9 07:09:57 PST 2006


mc_list accesses must be protected by xmit_lock.
Found by Eli Cohen.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: openib/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- openib/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	(revision 4812)
+++ openib/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	(working copy)
@@ -824,6 +824,7 @@ void ipoib_mcast_restart_task(void *dev_
 
 	ipoib_mcast_stop_thread(dev, 0);
 
+	spin_lock_bh(&dev->xmit_lock);
 	spin_lock_irqsave(&priv->lock, flags);
 
 	/*
@@ -896,7 +897,9 @@ void ipoib_mcast_restart_task(void *dev_
 			list_add_tail(&mcast->list, &remove_list);
 		}
 	}
+
 	spin_unlock_irqrestore(&priv->lock, flags);
+	spin_unlock_bh(&dev->xmit_lock);
 
 	/* We have to cancel outside of the spinlock */
 	list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {

-- 
MST



More information about the general mailing list