Skip to contentSkip to conversation

2.6.12-rc4-mm[12] - ULOG problem

DISCUSSION Andrew Morton 6 participants 24 messages May 19, 2005 – May 20, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This is the second report of this happening.

Begin forwarded message:

Date: Wed, 18 May 2005 23:10:49 -0400
From: Nick Orlov <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: 2.6.12-rc4-mm[12] - ULOG problem

ipt_ULOG fails to load starting from 2.6.12-rc4-mm1 with the following error message:

FATAL: Error inserting ipt_ULOG (/lib/modules/2.6.12-rc4-mm1-2/kernel/net/ipv4/netfilter/ipt_ULOG.ko): Cannot allocate memory

rc3-mm3 works fine.

Unfortunately, I wont have time to do a binary search till the weekend, but I hope you'll point suspicious patch(es) without it.

Any additional info available by request.

Signature · 2 lines
With best wishes,
	Nick Orlov.
#1 lore raw
Quoted 4 lines · Andrew Morton

This is the second report of this happening.

FATAL: Error inserting ipt_ULOG (/lib/modules/2.6.12-rc4-mm1-2/kernel/net/ipv4/netfilter/ipt_ULOG.ko): Cannot allocate memory

This probably means that someone has stolen the NETLINK_NFLOG id.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 6 lines · Herbert Xu
Quoted 4 lines · Andrew Morton

This is the second report of this happening.

FATAL: Error inserting ipt_ULOG (/lib/modules/2.6.12-rc4-mm1-2/kernel/net/ipv4/netfilter/ipt_ULOG.ko): Cannot allocate memory

Ah yes, thanks. netlink_kernel_create() has a dumbish return-value protocol.

Quoted 1 line

This probably means that someone has stolen the NETLINK_NFLOG id.

cn_init() uses NETLINK_NFLOG. Peculiar.

#3 lore raw
Quoted 6 lines · Andrew Morton
Quoted 5 lines · Herbert Xu
Quoted 3 lines · Andrew Morton

This is the second report of this happening.

Quoted 7 lines
Quoted 1 line
Quoted 1 line

FATAL: Error inserting ipt_ULOG (/lib/modules/2.6.12-rc4-mm1-2/kernel/net/ipv4/netfilter/ipt_ULOG.ko): Cannot allocate memory

Ah yes, thanks. netlink_kernel_create() has a dumbish return-value protocol.

Quoted 1 line

This probably means that someone has stolen the NETLINK_NFLOG id.

cn_init() uses NETLINK_NFLOG. Peculiar.

Yep...
One may use "unit" module parameter to specify different socket. Should I ask David Miller to allocate new one specially for connector?

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#4 lore raw
Quoted 10 lines · Evgeniy Polyakov
Quoted 8 lines · Andrew Morton
Quoted 6 lines · Herbert Xu
Quoted 4 lines · Andrew Morton

This is the second report of this happening.

FATAL: Error inserting ipt_ULOG (/lib/modules/2.6.12-rc4-mm1-2/kernel/net/ipv4/netfilter/ipt_ULOG.ko): Cannot allocate memory

Quoted 7 lines
Quoted 5 lines

Ah yes, thanks. netlink_kernel_create() has a dumbish return-value protocol.

Quoted 1 line

This probably means that someone has stolen the NETLINK_NFLOG id.

cn_init() uses NETLINK_NFLOG. Peculiar.

Yep...

Bah.

Quoted 1 line

One may use "unit" module parameter to specify different socket.

Is there any reason for being able to do that?

Quoted 1 line

Should I ask David Miller to allocate new one specially for connector?

Dave?

include/linux/netlink.h renamed from include/linux/netlink.h~connector-netlink-id-fix +1 -0
diff -puN include/linux/netlink.h~connector-netlink-id-fix include/linux/netlink.h
@@ -14,6 +14,7 @@
 #define NETLINK_SELINUX		7	/* SELinux event notifications */
 #define NETLINK_ARPD		8
 #define NETLINK_AUDIT		9	/* auditing */
+#define NETLINK_CONNECTOR	10	/* kernel connector */
 #define NETLINK_ROUTE6		11	/* af_inet6 route comm channel */
 #define NETLINK_IP6_FW		13
 #define NETLINK_DNRTMSG		14	/* DECnet routing messages */
drivers/connector/connector.c renamed from drivers/connector/connector.c~connector-netlink-id-fix +1 -1
diff -puN drivers/connector/connector.c~connector-netlink-id-fix drivers/connector/connector.c
@@ -33,7 +33,7 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Evgeniy Polyakov <[email protected]>");
 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector.");
 
-static int unit = NETLINK_NFLOG;
+static int unit = NETLINK_CONNECTOR;
 static u32 cn_idx = CN_IDX_CONNECTOR;
 static u32 cn_val = CN_VAL_CONNECTOR;
 

_

#5 lore raw
Quoted 17 lines · Andrew Morton
Quoted 16 lines · Evgeniy Polyakov
Quoted 13 lines · Andrew Morton
Quoted 6 lines · Herbert Xu
Quoted 4 lines · Andrew Morton

This is the second report of this happening.

FATAL: Error inserting ipt_ULOG (/lib/modules/2.6.12-rc4-mm1-2/kernel/net/ipv4/netfilter/ipt_ULOG.ko): Cannot allocate memory

Ah yes, thanks. netlink_kernel_create() has a dumbish return-value protocol.

Quoted 1 line

This probably means that someone has stolen the NETLINK_NFLOG id.

cn_init() uses NETLINK_NFLOG. Peculiar.

Quoted 7 lines
Quoted 1 line

Yep...

Bah.

Quoted 1 line

One may use "unit" module parameter to specify different socket.

Is there any reason for being able to do that?

It was created to be able to load several different connector devices from different modules [basically it was module1.ko unit=10, module2.ko unit=11 and so on].

Quoted 29 lines
Quoted 1 line

Should I ask David Miller to allocate new one specially for connector?

Dave?

diff -puN include/linux/netlink.h~connector-netlink-id-fix include/linux/netlink.h

include/linux/netlink.h renamed from include/linux/netlink.h~connector-netlink-id-fix +1 -0
@@ -14,6 +14,7 @@
 #define NETLINK_SELINUX		7	/* SELinux event notifications */
 #define NETLINK_ARPD		8
 #define NETLINK_AUDIT		9	/* auditing */
+#define NETLINK_CONNECTOR	10	/* kernel connector */
 #define NETLINK_ROUTE6		11	/* af_inet6 route comm channel */
 #define NETLINK_IP6_FW		13
 #define NETLINK_DNRTMSG		14	/* DECnet routing messages */

diff -puN drivers/connector/connector.c~connector-netlink-id-fix drivers/connector/connector.c

drivers/connector/connector.c renamed from drivers/connector/connector.c~connector-netlink-id-fix +1 -1
@@ -33,7 +33,7 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Evgeniy Polyakov <[email protected]>");
 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector.");
 
-static int unit = NETLINK_NFLOG;
+static int unit = NETLINK_CONNECTOR;
 static u32 cn_idx = CN_IDX_CONNECTOR;
 static u32 cn_val = CN_VAL_CONNECTOR;
 

_

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#6 lore raw
Quoted 6 lines · Evgeniy Polyakov
Quoted 2 lines

Is there any reason for being able to do that?

It was created to be able to load several different connector devices from different modules [basically it was module1.ko unit=10, module2.ko unit=11 and so on].

Loading multiple instances of the same module so that we get multiple
instances of its data structures? That's fairly ghastly.

We should remove the feature. If there is demonstrated need for multiple instances then it should be done by more conventional means - syscall, allocation of a device major then use the minor as a selector or whatever.

#7 lore raw
Quoted 10 lines · Andrew Morton
Quoted 6 lines · Evgeniy Polyakov
Quoted 2 lines

Is there any reason for being able to do that?

It was created to be able to load several different connector devices from different modules [basically it was module1.ko unit=10, module2.ko unit=11 and so on].

Loading multiple instances of the same module so that we get multiple
instances of its data structures? That's fairly ghastly.

It was not the same module.
it was quite different module which implemented similar functionality and used different connector device for different purposes.

Quoted 3 lines

We should remove the feature. If there is demonstrated need for multiple instances then it should be done by more conventional means - syscall, allocation of a device major then use the minor as a selector or whatever.

It is easy to use feature which prevents problems
with situation when the same socket number is used, for example, in 2.6 kernel while connector uses it in -mm tree.

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#8 lore raw
In reply to Andrew Morton
Quoted 3 lines · Andrew Morton

We should remove the feature. If there is demonstrated need for multiple instances then it should be done by more conventional means - syscall, allocation of a device major then use the minor as a selector or whatever.

I'd suggest removing the connector code completely.

- James

Signature · 2 lines
James Morris
<[email protected]>
#21 lore raw
In reply to James Morris
Quoted 6 lines · James Morris
Quoted 1 line · Andrew Morton

cn_init() uses NETLINK_NFLOG. Peculiar.

I raised this some time ago, and it was never fixed by the author.

Sharing as was done here is not proper; perhaps the suggestion from Andrew is the way to go.

The other thing we could do is allocate a set of IDs for private use (as in private IPs).
However, something like connector should only get one ID and it can do its own multiplexing based on "units".

cheers,
jamal

#9 lore raw
In reply to James Morris
Quoted 9 lines · James Morris
Quoted 3 lines · Andrew Morton

We should remove the feature. If there is demonstrated need for multiple instances then it should be done by more conventional means - syscall, allocation of a device major then use the minor as a selector or whatever.

I'd suggest removing the connector code completely.

How come? It seems sensible to have library code which consoldates the common netlink setup and teardown stuff and which offers a higher-level messaging API, although connector may be a bit overdesigned for that. The fork connector guys seemed to find it useful?

#10 lore raw
Quoted 4 lines · Andrew Morton

How come? It seems sensible to have library code which consoldates the common netlink setup and teardown stuff and which offers a higher-level messaging API, although connector may be a bit overdesigned for that. The fork connector guys seemed to find it useful?

I don't think it's the right implementation, and providing feedback on it has proven frustrating and unfruitful.

- James

Signature · 2 lines
James Morris
<[email protected]>
maintainer
#14 lore raw
In reply to Evgeniy Polyakov

From: Evgeniy Polyakov <[email protected]>
Date: Thu, 19 May 2005 11:06:25 +0400

Quoted 3 lines

It was created to be able to load several different connector devices from different modules [basically it was module1.ko unit=10, module2.ko unit=11 and so on].

That's bogus, each connector will need to allocate it's own specific define in the netlink header, and we're about to run out of numbers.

Please redesign the connector so that it doesn't eat more than one netlink number, we're running out of them soon.

maintainer
#16 lore raw
In reply to Andrew Morton

From: Andrew Morton <[email protected]>
Date: Wed, 18 May 2005 23:45:52 -0700

Quoted 3 lines
Quoted 1 line

Should I ask David Miller to allocate new one specially for connector?

Dave?

Giving the connector a single value 10 is OK, the rest of what the connector is doing in this area is not.

I wish you hadn't put the connector into -mm, it's really in need of several fixups still. The bogus reuse of the ULOG netlink number is simply indicative of that.

maintainer
#12 lore raw
In reply to James Morris

From: James Morris <[email protected]>
Date: Thu, 19 May 2005 09:19:33 -0400 (EDT)

Quoted 7 lines · Andrew Morton
Quoted 4 lines

We should remove the feature. If there is demonstrated need for multiple instances then it should be done by more conventional means - syscall, allocation of a device major then use the minor as a selector or whatever.

I'd suggest removing the connector code completely.

I totally agree, it's crap at the current time and the author doesn't fix the problems being shown in it, in fact he defends some of them even this one. It needs lots of work still.

maintainer
#22 lore raw
In reply to jamal

From: jamal <[email protected]>
Date: Thu, 19 May 2005 09:46:50 -0400

Quoted 2 lines

However, something like connector should only get one ID and it can do its own multiplexing based on "units".

Yes. There is no reason connector needs more than one netlink ID.

maintainer
#11 lore raw
In reply to James Morris

From: James Morris <[email protected]>
Date: Thu, 19 May 2005 13:09:44 -0400 (EDT)

Quoted 2 lines

I don't think it's the right implementation, and providing feedback on it has proven frustrating and unfruitful.

Yes, Evgeni is a complete control freak.

#23 lore raw
In reply to David S. Miller
Quoted 8 lines · David S. Miller

From: jamal <[email protected]>
Date: Thu, 19 May 2005 09:46:50 -0400

Quoted 2 lines

However, something like connector should only get one ID and it can do its own multiplexing based on "units".

Yes. There is no reason connector needs more than one netlink ID.

It does not require several IDs.

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#13 lore raw
In reply to David S. Miller
Quoted 9 lines · David S. Miller

From: James Morris <[email protected]>
Date: Thu, 19 May 2005 09:19:33 -0400 (EDT)

Quoted 6 lines · Andrew Morton
Quoted 4 lines

We should remove the feature. If there is demonstrated need for multiple instances then it should be done by more conventional means - syscall, allocation of a device major then use the minor as a selector or whatever.

Quoted 5 lines
Quoted 1 line

I'd suggest removing the connector code completely.

I totally agree, it's crap at the current time and the author doesn't fix the problems being shown in it, in fact he defends some of them even this one. It needs lots of work still.

There were no problems reported.
Completely.

What I defend is ability to function correctly when some changes may be introduced by providing some extensions that may be used.

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#15 lore raw
In reply to David S. Miller
Quoted 7 lines · David S. Miller

From: Evgeniy Polyakov <[email protected]>
Date: Thu, 19 May 2005 11:06:25 +0400

Quoted 3 lines

It was created to be able to load several different connector devices from different modules [basically it was module1.ko unit=10, module2.ko unit=11 and so on].

Quoted 6 lines

That's bogus, each connector will need to allocate it's own specific define in the netlink header, and we're about to run out of numbers.

Please redesign the connector so that it doesn't eat more than one netlink number, we're running out of them soon.

It does not require more than one socket number.
It just can use any other number provided.

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#17 lore raw
In reply to David S. Miller
Quoted 5 lines · David S. Miller

From: Andrew Morton <[email protected]>
Date: Wed, 18 May 2005 23:45:52 -0700

Quoted 2 lines
Quoted 1 line

Should I ask David Miller to allocate new one specially for connector?

Quoted 8 lines
Quoted 1 line

Dave?

Giving the connector a single value 10 is OK, the rest of what the connector is doing in this area is not.

I wish you hadn't put the connector into -mm, it's really in need of several fixups still. The bogus reuse of the ULOG netlink number is simply indicative of that.

And how does it indicate that it is bogus? :)
It is one netlink user that can use any socket number - and now it is called bogus.

What other people suggest is just create some wrapper over netlink_broadcast() and alloc_skb().
if you do think it will solve all problems, then I even will not say anything. Point.
I just want to note, that if you want message bus, you require at least oppsite direction, and thus input callback, and either several socket number for each user [kobject, audit, iscsi, xfrm - all they implement what connector already does] or some header and thus parser in input callback, and thus some registration mechanism. Magically it is what connector does. And nothing more, btw.
It only allows not to rewrite the whole driver just to move to new transport layer, only register new cn_dev device with different method.

Ok, Dave, we all see your point, feel free to remove connector, I will not bother people to include it yet another time... But I believe in a month or two someone will reinvent the wheel and create somthing similar. If it will be simple wrapper, then it just can not solve message bus problem, only notification, and thus someone will create it again.

Thank you.

P.S. smtp server from my old university years seems to still drop your messages, sorry for that, I will kick admins again.

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#18 lore raw
Quoted 6 lines · Evgeniy Polyakov

I just want to note, that if you want message bus, you require at least oppsite direction, and thus input callback, and either several socket number for each user [kobject, audit, iscsi, xfrm - all they implement what connector already does] or some header and thus parser in input callback, and thus some registration mechanism.

But if you are given your own ID, there should no issues, correct? i.e it will be no different than say rtnetlink. Users would still have to subscribe to topics etc, but thats something you already handle. IOW, Iam hoping you are not resorting to a single socket with some user space mux to do filtering.

cheers,
jamal

#19 lore raw
Quoted 11 lines · jamal
Quoted 6 lines · Evgeniy Polyakov

I just want to note, that if you want message bus, you require at least oppsite direction, and thus input callback, and either several socket number for each user [kobject, audit, iscsi, xfrm - all they implement what connector already does] or some header and thus parser in input callback, and thus some registration mechanism.

But if you are given your own ID, there should no issues, correct?

Yes.

Quoted 4 lines

i.e it will be no different than say rtnetlink. Users would still have to subscribe to topics etc, but thats something you already handle. IOW, Iam hoping you are not resorting to a single socket with some user space mux to do filtering.

Not following, sorry.
Userspace should use the same socket as kernel - my application previously
obtained it from dmesg and later used ULOG.

Quoted 3 lines

cheers,
jamal

Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski