Skip to content

Commit 4f71055

Browse files
Michael S. TsirkinRoland Dreier
authored andcommitted
IPoIB: protect child list in ipoib_ib_dev_flush
race condition: ipoib_ib_dev_flush is accessing child list without locks. Signed-off-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent 2e86541 commit 4f71055

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/infiniband/ulp/ipoib/ipoib_ib.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,13 @@ void ipoib_ib_dev_flush(void *_dev)
608608
if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
609609
ipoib_ib_dev_up(dev);
610610

611+
down(&priv->vlan_mutex);
612+
611613
/* Flush any child interfaces too */
612614
list_for_each_entry(cpriv, &priv->child_intfs, list)
613615
ipoib_ib_dev_flush(&cpriv->dev);
616+
617+
up(&priv->vlan_mutex);
614618
}
615619

616620
void ipoib_ib_dev_cleanup(struct net_device *dev)

0 commit comments

Comments
 (0)