netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC Patch net-next] ipv6: do not allow ipv6 module to be removed
@ 2013-09-04  9:12 Cong Wang
  2013-09-05 18:06 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2013-09-04  9:12 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Hideaki YOSHIFUJI, Stephen Hemminger, Cong Wang

There was some bug report on ipv6 module removal path before.
Also, as Stephen pointed out, after vxlan module gets ipv6 support,
the ipv6 stub it used is not safe against this module removal either.
So, let's just remove inet6_exit() so that ipv6 module will not be
able to be unloaded.

Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 136fe55..ad584eb 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1023,51 +1023,4 @@ out_unregister_tcp_proto:
 }
 module_init(inet6_init);
 
-static void __exit inet6_exit(void)
-{
-	if (disable_ipv6_mod)
-		return;
-
-	/* First of all disallow new sockets creation. */
-	sock_unregister(PF_INET6);
-	/* Disallow any further netlink messages */
-	rtnl_unregister_all(PF_INET6);
-
-	udpv6_exit();
-	udplitev6_exit();
-	tcpv6_exit();
-
-	/* Cleanup code parts. */
-	ipv6_packet_cleanup();
-	ipv6_frag_exit();
-	ipv6_exthdrs_exit();
-	addrconf_cleanup();
-	ip6_flowlabel_cleanup();
-	ip6_route_cleanup();
-#ifdef CONFIG_PROC_FS
-
-	/* Cleanup code parts. */
-	if6_proc_exit();
-	ipv6_misc_proc_exit();
-	udplite6_proc_exit();
-	raw6_proc_exit();
-#endif
-	ipv6_netfilter_fini();
-	ipv6_stub = NULL;
-	igmp6_cleanup();
-	ndisc_cleanup();
-	ip6_mr_cleanup();
-	icmpv6_cleanup();
-	rawv6_exit();
-
-	unregister_pernet_subsys(&inet6_net_ops);
-	proto_unregister(&rawv6_prot);
-	proto_unregister(&udplitev6_prot);
-	proto_unregister(&udpv6_prot);
-	proto_unregister(&tcpv6_prot);
-
-	rcu_barrier(); /* Wait for completion of call_rcu()'s */
-}
-module_exit(inet6_exit);
-
 MODULE_ALIAS_NETPROTO(PF_INET6);

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

* Re: [RFC Patch net-next] ipv6: do not allow ipv6 module to be removed
  2013-09-04  9:12 [RFC Patch net-next] ipv6: do not allow ipv6 module to be removed Cong Wang
@ 2013-09-05 18:06 ` David Miller
  2013-09-06  2:52   ` Cong Wang
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2013-09-05 18:06 UTC (permalink / raw)
  To: amwang; +Cc: netdev, yoshfuji, stephen

From: Cong Wang <amwang@redhat.com>
Date: Wed,  4 Sep 2013 17:12:50 +0800

> There was some bug report on ipv6 module removal path before.
> Also, as Stephen pointed out, after vxlan module gets ipv6 support,
> the ipv6 stub it used is not safe against this module removal either.
> So, let's just remove inet6_exit() so that ipv6 module will not be
> able to be unloaded.
> 
> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> Cc: Stephen Hemminger <stephen@networkplumber.org>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

I think we should make an effort to make ipv6 unloadable.  If you
believe little effort is being put into this now, even less will
be expended if I apply a patch like this one.

And this patch has a lot of problems, you aren't removing all of
the functions which will be completely unused.

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

* Re: [RFC Patch net-next] ipv6: do not allow ipv6 module to be removed
  2013-09-05 18:06 ` David Miller
@ 2013-09-06  2:52   ` Cong Wang
  2013-09-06  2:58     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Cong Wang @ 2013-09-06  2:52 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, yoshfuji, stephen

On Thu, 2013-09-05 at 14:06 -0400, David Miller wrote:
> From: Cong Wang <amwang@redhat.com>
> Date: Wed,  4 Sep 2013 17:12:50 +0800
> 
> > There was some bug report on ipv6 module removal path before.
> > Also, as Stephen pointed out, after vxlan module gets ipv6 support,
> > the ipv6 stub it used is not safe against this module removal either.
> > So, let's just remove inet6_exit() so that ipv6 module will not be
> > able to be unloaded.
> > 
> > Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
> > Cc: Stephen Hemminger <stephen@networkplumber.org>
> > Cc: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Cong Wang <amwang@redhat.com>
> 
> I think we should make an effort to make ipv6 unloadable.  If you
> believe little effort is being put into this now, even less will
> be expended if I apply a patch like this one.
> 
> And this patch has a lot of problems, you aren't removing all of
> the functions which will be completely unused.

They are still used in the cleanup path of inet6_init() as well, can't
be removed completely.

Thanks!

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

* Re: [RFC Patch net-next] ipv6: do not allow ipv6 module to be removed
  2013-09-06  2:52   ` Cong Wang
@ 2013-09-06  2:58     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-09-06  2:58 UTC (permalink / raw)
  To: amwang; +Cc: netdev, yoshfuji, stephen

From: Cong Wang <amwang@redhat.com>
Date: Fri, 06 Sep 2013 10:52:51 +0800

> On Thu, 2013-09-05 at 14:06 -0400, David Miller wrote:
>> And this patch has a lot of problems, you aren't removing all of
>> the functions which will be completely unused.
> 
> They are still used in the cleanup path of inet6_init() as well, can't
> be removed completely.

Good point.

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

end of thread, other threads:[~2013-09-06  2:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04  9:12 [RFC Patch net-next] ipv6: do not allow ipv6 module to be removed Cong Wang
2013-09-05 18:06 ` David Miller
2013-09-06  2:52   ` Cong Wang
2013-09-06  2:58     ` David Miller

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).