netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com, Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Subject: [PATCH] decnet initialization race
Date: Wed, 14 Jan 2004 16:40:45 -0800	[thread overview]
Message-ID: <20040114164045.06dd85f3.shemminger@osdl.org> (raw)
In-Reply-To: <20040113163631.1a9c1a59.davem@redhat.com>

Decnet exposes itself to proc and packets before it has finished initializing.
This was always a race, but the notifier replay might expose it worse.

diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
--- a/net/decnet/af_decnet.c	Wed Jan 14 16:27:05 2004
+++ b/net/decnet/af_decnet.c	Wed Jan 14 16:27:05 2004
@@ -2363,17 +2363,16 @@
 	if (!dn_sk_cachep)
 		return -ENOMEM;
 
-	sock_register(&dn_family_ops);
-	dev_add_pack(&dn_dix_packet_type);
-	register_netdevice_notifier(&dn_dev_notifier);
-
-	proc_net_fops_create("decnet", S_IRUGO, &dn_socket_seq_fops);
-
 	dn_neigh_init();
 	dn_dev_init();
 	dn_route_init();
 	dn_fib_init();
 
+	sock_register(&dn_family_ops);
+	dev_add_pack(&dn_dix_packet_type);
+	register_netdevice_notifier(&dn_dev_notifier);
+
+	proc_net_fops_create("decnet", S_IRUGO, &dn_socket_seq_fops);
 	dn_register_sysctl();
 
 	return 0;

  reply	other threads:[~2004-01-15  0:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 18:58 [PATCH] (1/5) replay netdev notifier events on registration Stephen Hemminger
2004-01-14  0:36 ` David S. Miller
2004-01-15  0:40   ` Stephen Hemminger [this message]
2004-01-15  8:45     ` [PATCH] decnet initialization race David S. Miller
2004-01-15  0:43   ` [PATH] atm/clip device discovery on init not needed Stephen Hemminger
2004-01-15  8:44     ` David S. Miller
2004-01-15 22:59     ` Stephen Hemminger
2004-01-15 23:00       ` David S. Miller
2004-01-15  0:44   ` [PATCH] (1/5) replay netdev notifier events on registration Stephen Hemminger
2004-01-15  8:42     ` David S. Miller
2004-01-15 18:16       ` Stephen Hemminger
2004-01-15 19:51         ` David S. Miller
2004-01-16  3:19       ` chas williams

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=20040114164045.06dd85f3.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=acme@conectiva.com.br \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.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 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).