mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
ipv6: remove extra dev_hold() for fallback tunnels
commit0d7a7b2014
upstream. My previous commits added a dev_hold() in tunnels ndo_init(), but forgot to remove it from special functions setting up fallback tunnels. Fallback tunnels do call their respective ndo_init() This leads to various reports like : unregister_netdevice: waiting for ip6gre0 to become free. Usage count = 2 Fixes:48bb569726
("ip6_tunnel: sit: proper dev_{hold|put} in ndo_[un]init methods") Fixes:6289a98f08
("sit: proper dev_{hold|put} in ndo_[un]init methods") Fixes:40cb881b5a
("ip6_vti: proper dev_{hold|put} in ndo_[un]init methods") Fixes:7f700334be
("ip6_gre: proper dev_{hold|put} in ndo_[un]init methods") Signed-off-by: Eric Dumazet <edumazet@google.com> Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7d46f70b3f
commit
3cc5c35802
4 changed files with 0 additions and 6 deletions
|
@ -350,7 +350,6 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
|
||||||
if (!(nt->parms.o_flags & TUNNEL_SEQ))
|
if (!(nt->parms.o_flags & TUNNEL_SEQ))
|
||||||
dev->features |= NETIF_F_LLTX;
|
dev->features |= NETIF_F_LLTX;
|
||||||
|
|
||||||
dev_hold(dev);
|
|
||||||
ip6gre_tunnel_link(ign, nt);
|
ip6gre_tunnel_link(ign, nt);
|
||||||
return nt;
|
return nt;
|
||||||
|
|
||||||
|
@ -1124,8 +1123,6 @@ static void ip6gre_fb_tunnel_init(struct net_device *dev)
|
||||||
strcpy(tunnel->parms.name, dev->name);
|
strcpy(tunnel->parms.name, dev->name);
|
||||||
|
|
||||||
tunnel->hlen = sizeof(struct ipv6hdr) + 4;
|
tunnel->hlen = sizeof(struct ipv6hdr) + 4;
|
||||||
|
|
||||||
dev_hold(dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1905,7 +1905,6 @@ static int __net_init ip6_fb_tnl_dev_init(struct net_device *dev)
|
||||||
struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
|
struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
|
||||||
|
|
||||||
t->parms.proto = IPPROTO_IPV6;
|
t->parms.proto = IPPROTO_IPV6;
|
||||||
dev_hold(dev);
|
|
||||||
|
|
||||||
rcu_assign_pointer(ip6n->tnls_wc[0], t);
|
rcu_assign_pointer(ip6n->tnls_wc[0], t);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -934,7 +934,6 @@ static int __net_init vti6_fb_tnl_dev_init(struct net_device *dev)
|
||||||
struct vti6_net *ip6n = net_generic(net, vti6_net_id);
|
struct vti6_net *ip6n = net_generic(net, vti6_net_id);
|
||||||
|
|
||||||
t->parms.proto = IPPROTO_IPV6;
|
t->parms.proto = IPPROTO_IPV6;
|
||||||
dev_hold(dev);
|
|
||||||
|
|
||||||
rcu_assign_pointer(ip6n->tnls_wc[0], t);
|
rcu_assign_pointer(ip6n->tnls_wc[0], t);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1407,7 +1407,6 @@ static void __net_init ipip6_fb_tunnel_init(struct net_device *dev)
|
||||||
iph->ihl = 5;
|
iph->ihl = 5;
|
||||||
iph->ttl = 64;
|
iph->ttl = 64;
|
||||||
|
|
||||||
dev_hold(dev);
|
|
||||||
rcu_assign_pointer(sitn->tunnels_wc[0], tunnel);
|
rcu_assign_pointer(sitn->tunnels_wc[0], tunnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue