mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland Dreier <rolandd@cisco.com>
To: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [git patch review 5/8] IPoIB: protect child list in ipoib_ib_dev_flush
Date: Wed, 30 Nov 2005 00:57:25 +0000	[thread overview]
Message-ID: <1133312245797-01403858bd5f112a@cisco.com> (raw)
In-Reply-To: <1133312245797-2006ed5b68ef5482@cisco.com>

race condition: ipoib_ib_dev_flush is accessing child list without locks.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

---

 drivers/infiniband/ulp/ipoib/ipoib_ib.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

applies-to: e58f418dd8e64675b1dbaa6db92d7c1e606d1506
4f71055a45a503273c039d80db8ba9b13cb17549
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 54ef2fe..2388580 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -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)
---
0.99.9k

  reply	other threads:[~2005-11-30  0:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30  0:57 [git patch review 1/8] IPoIB: reinitialize path struct's completion for every query Roland Dreier
2005-11-30  0:57 ` [git patch review 2/8] IPoIB: always set path->query to NULL when query finishes Roland Dreier
2005-11-30  0:57   ` [git patch review 3/8] IPoIB: reinitialize mcast structs' completions for every query Roland Dreier
2005-11-30  0:57     ` [git patch review 4/8] IPoIB: don't zero members after we allocate with kzalloc Roland Dreier
2005-11-30  0:57       ` Roland Dreier [this message]
2005-11-30  0:57         ` [git patch review 6/8] IPoIB: fix error handling in ipoib_open Roland Dreier
2005-11-30  0:57           ` [git patch review 7/8] IB/mthca: fix posting of send lists of length >= 255 on mem-free HCAs Roland Dreier
2005-11-30  0:57             ` [git patch review 8/8] IB/uverbs: track multicast group membership for userspace QPs Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1133312245797-01403858bd5f112a@cisco.com \
    --to=rolandd@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®