All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	stable <stable@vger.kernel.org>,
	Clark Williams <williams@redhat.com>,
	"Luis Claudio R. Goncalves" <lclaudio@uudg.org>,
	John Kacur <jkacur@redhat.com>
Subject: [PATCH 1/2] sit: Unregister sit devices with rtnl_link_ops
Date: Tue, 28 Jan 2014 15:57:57 -0500	[thread overview]
Message-ID: <20140128210543.190799134@goodmis.org> (raw)
In-Reply-To: 20140128205756.074448668@goodmis.org

[-- Attachment #1: 0001-sit-Unregister-sit-devices-with-rtnl_link_ops.patch --]
[-- Type: text/plain, Size: 1665 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The backport of upstream commit 205983c43700ac3 ("sit: allow to use rtnl
ops on fb tunnel") had a dependency on commit 5e6700b3bf98 ("sit: add
support of x-netns"). The dependency was on the way that commit
unregistered the sit devices.

Since the entire commit 5e6700b3bf98 is not necessary for a backport
we only need to backport the part required for the backport of
205983c43700ac3. This is the loop to unregister the sit devices where
dev->rtnl_link_ops == &sit_link_ops.

Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 net/ipv6/sit.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 0491264..3652033 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1529,6 +1529,10 @@ static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_hea
 {
 	int prio;
 
+	for_each_netdev_safe(net, dev, aux)
+		if (dev->rtnl_link_ops == &sit_link_ops)
+			unregister_netdevice_queue(dev, head);
+
 	for (prio = 1; prio < 4; prio++) {
 		int h;
 		for (h = 0; h < HASH_SIZE; h++) {
@@ -1536,7 +1540,12 @@ static void __net_exit sit_destroy_tunnels(struct sit_net *sitn, struct list_hea
 
 			t = rtnl_dereference(sitn->tunnels[prio][h]);
 			while (t != NULL) {
-				unregister_netdevice_queue(t->dev, head);
+				/* If dev is in the same netns, it has already
+				 * been added to the list by the previous loop.
+				 */
+				if (dev_net(t->dev) != net)
+					unregister_netdevice_queue(t->dev,
+								   head);
 				t = rtnl_dereference(t->next);
 			}
 		}
-- 
1.8.4.3



  reply	other threads:[~2014-01-28 21:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28 20:57 [PATCH 0/2] [BUG FIXES - 3.10.27] sit: More backports Steven Rostedt
2014-01-28 20:57 ` Steven Rostedt [this message]
2014-01-28 20:57 ` [PATCH 2/2] sit: fix use after free of fb_tunnel_dev Steven Rostedt
2014-01-29  7:52 ` [PATCH 0/2] [BUG FIXES - 3.10.27] sit: More backports David Miller
2014-01-29 12:59   ` Steven Rostedt
2014-01-29 11:04 ` Nicolas Dichtel
2014-01-29 12:57   ` Steven Rostedt
2014-01-29 16:04     ` Nicolas Dichtel
2014-01-29 17:21       ` Willem de Bruijn
2014-01-29 20:48       ` Steven Rostedt
2014-01-30  9:28         ` Nicolas Dichtel
2014-01-30  9:28           ` Nicolas Dichtel
2014-01-30 10:09           ` [PATCH linux-3.10.y 1/3] sit: fix double free of fb_tunnel_dev on exit Nicolas Dichtel
2014-01-30 10:09             ` [PATCH linux-3.10.y 2/3] Revert "ip6tnl: fix use after free of fb_tnl_dev" Nicolas Dichtel
2014-01-30 10:09             ` [PATCH linux-3.10.y 3/3] ip6tnl: fix double free of fb_tnl_dev on exit Nicolas Dichtel
2014-01-30 13:31           ` [PATCH 0/2] [BUG FIXES - 3.10.27] sit: More backports Steven Rostedt
2014-01-30 13:42             ` Nicolas Dichtel
2014-01-30 13:42               ` Nicolas Dichtel
2014-01-30 22:10               ` Steven Rostedt
2014-01-31  8:24                 ` [PATCH linux-3.10.y v2 1/3] sit: fix double free of fb_tunnel_dev on exit Nicolas Dichtel
2014-01-31  8:24                   ` [PATCH linux-3.10.y v2 2/3] Revert "ip6tnl: fix use after free of fb_tnl_dev" Nicolas Dichtel
2014-01-31  8:24                   ` [PATCH linux-3.10.y v2 3/3] ip6tnl: fix double free of fb_tnl_dev on exit Nicolas Dichtel
2014-01-31 17:19                   ` [PATCH linux-3.10.y v2 1/3] sit: fix double free of fb_tunnel_dev " Steven Rostedt

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=20140128210543.190799134@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=jkacur@redhat.com \
    --cc=lclaudio@uudg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=stable@vger.kernel.org \
    --cc=williams@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.