netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [1/1] netlink: no need to crash if table does not exist.
@ 2007-03-21 10:44 Evgeniy Polyakov
  2007-03-21 10:54 ` Patrick McHardy
  0 siblings, 1 reply; 5+ messages in thread
From: Evgeniy Polyakov @ 2007-03-21 10:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

We would already do that on init.
Some things become very confused, when nl_table is not used to store
netlink sockets.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>

23ebdcf1f439cde050a63f33897d5b099fe08c95
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 9b69d9b..071e4d7 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1330,8 +1330,6 @@ netlink_kernel_create(int unit, unsigned int groups,
 	struct netlink_sock *nlk;
 	unsigned long *listeners = NULL;
 
-	BUG_ON(!nl_table);
-
 	if (unit<0 || unit>=MAX_LINKS)
 		return NULL;
 

-- 
	Evgeniy Polyakov

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

* Re: [1/1] netlink: no need to crash if table does not exist.
  2007-03-21 10:44 [1/1] netlink: no need to crash if table does not exist Evgeniy Polyakov
@ 2007-03-21 10:54 ` Patrick McHardy
  2007-03-21 10:58   ` Evgeniy Polyakov
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick McHardy @ 2007-03-21 10:54 UTC (permalink / raw)
  To: Evgeniy Polyakov; +Cc: David Miller, netdev

Evgeniy Polyakov wrote:
> We would already do that on init.
> Some things become very confused, when nl_table is not used to store
> netlink sockets.


Its unnecessary, but I don't understand what the problem is.
Why would it be NULL and what gets confused?


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

* Re: [1/1] netlink: no need to crash if table does not exist.
  2007-03-21 10:54 ` Patrick McHardy
@ 2007-03-21 10:58   ` Evgeniy Polyakov
  2007-03-27 23:41     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Evgeniy Polyakov @ 2007-03-21 10:58 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: David Miller, netdev

On Wed, Mar 21, 2007 at 11:54:45AM +0100, Patrick McHardy (kaber@trash.net) wrote:
> Evgeniy Polyakov wrote:
> > We would already do that on init.
> > Some things become very confused, when nl_table is not used to store
> > netlink sockets.
> 
> 
> Its unnecessary, but I don't understand what the problem is.
> Why would it be NULL and what gets confused?

There is no problem as-is, but I implement unified cache for different
sockets (currently tcp/udp/raw and netlink are supported), which does
not use that table, so I currently wrap all access code into special
ifdefs, this one can be wrapped too, but since it is not needed, it
saves couple of lines of code.

-- 
	Evgeniy Polyakov

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

* Re: [1/1] netlink: no need to crash if table does not exist.
  2007-03-21 10:58   ` Evgeniy Polyakov
@ 2007-03-27 23:41     ` David Miller
  2007-03-28  8:43       ` Evgeniy Polyakov
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2007-03-27 23:41 UTC (permalink / raw)
  To: johnpol; +Cc: kaber, netdev

From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Date: Wed, 21 Mar 2007 13:58:47 +0300

> On Wed, Mar 21, 2007 at 11:54:45AM +0100, Patrick McHardy (kaber@trash.net) wrote:
> > Evgeniy Polyakov wrote:
> > > We would already do that on init.
> > > Some things become very confused, when nl_table is not used to store
> > > netlink sockets.
> > 
> > 
> > Its unnecessary, but I don't understand what the problem is.
> > Why would it be NULL and what gets confused?
> 
> There is no problem as-is, but I implement unified cache for different
> sockets (currently tcp/udp/raw and netlink are supported), which does
> not use that table, so I currently wrap all access code into special
> ifdefs, this one can be wrapped too, but since it is not needed, it
> saves couple of lines of code.

It is needed.  It is there to make sure that a kernel netlink
socket is not created before the af_netlink init code runs.

We've had sequencing bugs like that in the initcall call chain
in the past, that's why the check is there.

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

* Re: [1/1] netlink: no need to crash if table does not exist.
  2007-03-27 23:41     ` David Miller
@ 2007-03-28  8:43       ` Evgeniy Polyakov
  0 siblings, 0 replies; 5+ messages in thread
From: Evgeniy Polyakov @ 2007-03-28  8:43 UTC (permalink / raw)
  To: David Miller; +Cc: kaber, netdev

On Tue, Mar 27, 2007 at 04:41:54PM -0700, David Miller (davem@davemloft.net) wrote:
> > There is no problem as-is, but I implement unified cache for different
> > sockets (currently tcp/udp/raw and netlink are supported), which does
> > not use that table, so I currently wrap all access code into special
> > ifdefs, this one can be wrapped too, but since it is not needed, it
> > saves couple of lines of code.
> 
> It is needed.  It is there to make sure that a kernel netlink
> socket is not created before the af_netlink init code runs.
> 
> We've had sequencing bugs like that in the initcall call chain
> in the past, that's why the check is there.

Argh, I see.
I fail to find exact commit (at least it was not in 2.4 and was created
before 2.6.12), but it is ineed neeed.

Thanks for explaination.

-- 
	Evgeniy Polyakov

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

end of thread, other threads:[~2007-03-28  8:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-21 10:44 [1/1] netlink: no need to crash if table does not exist Evgeniy Polyakov
2007-03-21 10:54 ` Patrick McHardy
2007-03-21 10:58   ` Evgeniy Polyakov
2007-03-27 23:41     ` David Miller
2007-03-28  8:43       ` Evgeniy Polyakov

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