netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ipsec] vti6: fix uninit when using x-netns
@ 2015-04-02 15:31 Nicolas Dichtel
  2015-04-07  8:59 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Dichtel @ 2015-04-02 15:31 UTC (permalink / raw)
  To: steffen.klassert, herbert, davem; +Cc: netdev, Yao Xiwei, Nicolas Dichtel

From: Yao Xiwei <xiwei.yao@6wind.com>

When the kernel deleted a vti6 interface, this interface was not removed from
the tunnels list. Thus, when the ip6_vti module was removed, this old interface
was found and the kernel tried to delete it again. This was leading to a kernel
panic.

Fixes: 61220ab34948 ("vti6: Enable namespace changing")
Signed-off-by: Yao Xiwei <xiwei.yao@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 net/ipv6/ip6_vti.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index ace10d0b3aac..96ba579917c1 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -288,8 +288,7 @@ static struct ip6_tnl *vti6_locate(struct net *net, struct __ip6_tnl_parm *p,
 static void vti6_dev_uninit(struct net_device *dev)
 {
 	struct ip6_tnl *t = netdev_priv(dev);
-	struct net *net = dev_net(dev);
-	struct vti6_net *ip6n = net_generic(net, vti6_net_id);
+	struct vti6_net *ip6n = net_generic(t->net, vti6_net_id);
 
 	if (dev == ip6n->fb_tnl_dev)
 		RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL);
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH ipsec] vti6: fix uninit when using x-netns
  2015-04-02 15:31 [PATCH ipsec] vti6: fix uninit when using x-netns Nicolas Dichtel
@ 2015-04-07  8:59 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2015-04-07  8:59 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: herbert, davem, netdev, Yao Xiwei

On Thu, Apr 02, 2015 at 05:31:17PM +0200, Nicolas Dichtel wrote:
> From: Yao Xiwei <xiwei.yao@6wind.com>
> 
> When the kernel deleted a vti6 interface, this interface was not removed from
> the tunnels list. Thus, when the ip6_vti module was removed, this old interface
> was found and the kernel tried to delete it again. This was leading to a kernel
> panic.
> 
> Fixes: 61220ab34948 ("vti6: Enable namespace changing")
> Signed-off-by: Yao Xiwei <xiwei.yao@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

Patch applied to the ipsec tree, thanks a lot!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-07  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-02 15:31 [PATCH ipsec] vti6: fix uninit when using x-netns Nicolas Dichtel
2015-04-07  8:59 ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).