Skip to contentSkip to conversation

feature request - why not make netif_rx() a pointer?

DISCUSSION Jean Tourrilhes 10 participants 16 messages Oct 23, 2002 – Oct 25, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines · Slavcho Nikolov

Non GPL modules that want to attach themselves between all L2 drivers and upper layers would not have to incur a performance loss if netif_rx() is made a
pointer instead of a function (whether or not NET filters are compiled in the kernel).
Currently control can be easily wrested from netif_rx() and others through injection of a few instructions into the running kernel (SMC - self modifying code)

Assuming that every L2 is Ethernet and every L3 is IP ? Well, I've got news for you : IrDA drivers are using
netif_rx() to pass IrLAP frames to the IrDA stack, and 802.11 driver in the future will pass 802.11 frames to the 802.2 LLC layer via netif_rx().
Please don't do that, I don't want people breaking the IrDA
stack in weird ways just because some random clueless code hijacked netif_rx(). Use netfilters, or define your own private protocol/packet type to do what you want.

Regards,

Jean

#1 lore raw

Unfortunately, I cannot assume that every L2 (or maybe I can, we'll see) is ethernet and I definitely cannot know in advance that every L3 is IP. Nor can the assumption be made that netfilter has been built into the kernel.
If I define my own private protocol handler (to catch all), I see cloned skb's
which is not what I want. I tried that and dropped each one of them in the handler, yet traffic continued to flow unimpeded (so I must have dropped clones).
As for GPL, I hope that commercial enterprises be allowed to utilize business models
which do not necessarily consist in providing services around free software. The more replaceable hooks you provide to filesystems and network stacks, the better.
S.N.

| Assuming that every L2 is Ethernet and every L3 is IP ?
| Well, I've got news for you : IrDA drivers are using
| netif_rx() to pass IrLAP frames to the IrDA stack, and 802.11 driver
| in the future will pass 802.11 frames to the 802.2 LLC layer via
| netif_rx().
| Please don't do that, I don't want people breaking the IrDA
| stack in weird ways just because some random clueless code hijacked
| netif_rx(). Use netfilters, or define your own private protocol/packet
| type to do what you want.
#2 lore raw
Quoted 5 lines · Slavcho Nikolov

As for GPL, I hope that commercial enterprises be allowed to utilize business models
which do not necessarily consist in providing services around free software. The more replaceable hooks you provide to filesystems and network stacks, the better.

I don't think you understand the nature of the GPL and linux development.

The kernel developers do not have any obligation to anything other than technical excellence. You're getting a highly optimized operating system *at no financial cost*. In return, the community requires that certain types of modifications be made publicly available.

If you want to replace the messaging code, make a GPL'd kernel patch and make it available to your clients (of course they can then publish it all over the place if they so desire). If those terms are not acceptable, there's always BSD.

Chris

Signature · 4 lines
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: [email protected]
#3 lore raw

over&out (Re: feature request - why not make netif_rx() a pointer?)

Chris Friesen wrote
| I don't think you understand the nature of the GPL and linux development.

What a presumptuous opening statement!

| The kernel developers do not have any obligation to anything other than
| technical excellence.  You're getting a highly optimized operating
| system *at no financial cost*.  In return, the community requires that
| certain types of modifications be made publicly available.

Yes, many companies from time to time feed smaller or larger contributions back into the community.
But they don't usually release *all* their modifications because they just might be irrelevant to everyone but a small niche of enterprise users.

| If you want to replace the messaging code, make a GPL'd kernel patch and
| make it available to your clients (of course they can then publish it
| all over the place if they so desire).  If those terms are not
| acceptable, there's always BSD.

It doesn't quite work that way. Big name distributors (e.g. Suse, Redhat) usually supply
and support big customers with Linux distributions. Third parties usually supply modules.
Integration of the two is demanded by the customer, so it's not our choice to
use BSD or ask the end users that our patches be applied and their kernels recompiled.
Certainly patches can be rolled out but it's a costly proposition (especially to customers)
and requires a level of expertise and commitment on the part of the customers that
may not be available.

Nearly every storage or networking startup that uses Linux (hundreds of them exist)
has tried to find hooks into the filesystems or network stacks, within the constraints
of modules and GPL. It isn't always easy to insert oneself where we want but they have found interesting solutions and work-arounds whether or not on the
legal grounds are shaky.
All I said was that it's good to make life easier for these startups. S.N.

#4 lore raw

Re: over&out (Re: feature request - why not make netif_rx() a pointer?)

Quoted 4 lines · Slavcho Nikolov

Chris Friesen wrote
| I don't think you understand the nature of the GPL and linux development.

What a presumptuous opening statement!

It is a statement of opinion based on proximate evidence and was phrased as such. Only a statement of fact not in evidence could have been presumptuous. You could persuade us that he is wrong by showing us your applicable understanding.

Quoted 9 lines
| The kernel developers do not have any obligation to anything other than
| technical excellence.  You're getting a highly optimized operating
| system *at no financial cost*.  In return, the community requires that
| certain types of modifications be made publicly available.

Yes, many companies from time to time feed smaller or larger contributions back into the community.
But they don't usually release *all* their modifications because they just might be irrelevant to everyone but a small niche of enterprise users.

That is obviously untrue or a complete misunderstanding.

Even the tiniest, most specialized patch is more relevant than a spelling error in a comment or some crook from Nigeria asking for access to our bank accounts. If the patches are really irrelevant then it won't matter to you if they are publicly available. Maybe they won't seem so irrelevant to someone else.

There would be little objection to their posting these irrelevant modifications here. The GPL only requires that they be made available. Stick them somewhere on your web site with an obscure link pointing to them.

Irrelevance is no reason not to share patches. Shamefully bad code i can see not sharing, but such bad code shouldn't be in a commercial offering. The only reason not to share commercially viable patches is the same reason the Linux kernel is GPL.

Pay the price (free code) or shop somewhere else. With GPL that is _your_ choice.

Signature · 5 lines
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		[email protected]

		Remember Cernan and Schmitt
#5 lore raw

Re: over&out (Re: feature request - why not make netif_rx() a pointer?)

Quoted 4 lines · jw schultz

There would be little objection to their posting these irrelevant modifications here. The GPL only requires that they be made available. Stick them somewhere on your web site with an obscure link pointing to them.

<nitpick>

IANAL but AFAIK the GPL V2 requires you to either distribute the source/patch together with the binary or include a *written* obligation valid for three years to supply the sources to any thrid party.

So, for example, if you disribute the binary on a CD, or some embedded device, sticking the patch somewhere on your web site with an obscure link pointing to them is technicaly a violation of the GPL.

But as I said, this is just nitpicking... :-)

</nitpick>

Signature · 4 lines
Gilad Ben-Yossef <[email protected]>
http://benyossef.com

 "Geeks rock bands cool name #8192: RAID against the machine"
#6 lore raw

Re: over&out (Re: feature request - why not make netif_rx() a pointer?)

Quoted 7 lines · Gilad Ben-Yossef

IANAL but AFAIK the GPL V2 requires you to either distribute the source/patch together with the binary or include a *written* obligation valid for three years to supply the sources to any thrid party.

So, for example, if you disribute the binary on a CD, or some embedded device, sticking the patch somewhere on your web site with an obscure link pointing to them is technicaly a violation of the GPL.

You could hide the source in the documentation, no one ever reads that ;)

Ben

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#7 lore raw

Re: over&out (Re: feature request - why not make netif_rx() a pointer?)

In reply to Slavcho Nikolov
Quoted 5 lines · Slavcho Nikolov

...
Yes, many companies from time to time feed smaller or larger contributions back into the community.
But they don't usually release *all* their modifications because they just might be irrelevant to everyone but a small niche of enterprise users.

It might be that a modification isn't of big interest for the majority of users but:
- It might be interesting for people working in similar niches.
- E.g. several development boards are supported in the MIPS port in the standard Linux kernel. The niche of people using them isn't very big but this doesn't prevent the inclusion into the main kernel.

Quoted 5 lines
| If you want to replace the messaging code, make a GPL'd kernel patch and
| make it available to your clients (of course they can then publish it
| all over the place if they so desire).  If those terms are not
| acceptable, there's always BSD.
Quoted 13 lines

It doesn't quite work that way. Big name distributors (e.g. Suse, Redhat) usually supply
and support big customers with Linux distributions. Third parties usually supply modules.
Integration of the two is demanded by the customer, so it's not our choice to
use BSD or ask the end users that our patches be applied and their kernels recompiled.
Certainly patches can be rolled out but it's a costly proposition (especially to customers)
and requires a level of expertise and commitment on the part of the customers that
may not be available.

But this doesn't prevent you from releasing the source code of your module under the terms of the GPL.

Quoted 8 lines

Nearly every storage or networking startup that uses Linux (hundreds of them exist)
has tried to find hooks into the filesystems or network stacks, within the constraints
of modules and GPL. It isn't always easy to insert oneself where we want but they have found interesting solutions and work-arounds whether or not on the
legal grounds are shaky.

The legal grounds become more shaky as soon as you consider that court decisions might be different in different countries. If someone wants to sue you he might have the possibility to choose between different countries where he wants to sue you... 8)

Quoted 2 lines

All I said was that it's good to make life easier for these startups. S.N.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#8 lore raw
In reply to Slavcho Nikolov
Quoted 4 lines · Slavcho Nikolov

Unfortunately, I cannot assume that every L2 (or maybe I can, we'll see) is ethernet and I definitely cannot know in advance that every L3 is IP. Nor can the assumption be made that netfilter has been built into the kernel.

So, you thing assuming a modified netif_rx is different than
assuming netfilter support ?
Your idea is just too dangerous.

Quoted 5 lines

If I define my own private protocol handler (to catch all), I see cloned skb's
which is not what I want. I tried that and dropped each one of them in the handler, yet traffic continued to flow unimpeded (so I must have dropped clones).

For this to work, you need to modify the driver. The driver
generates a private packet type or protocol, and you will be the only to to catch it.

Quoted 5 lines

As for GPL, I hope that commercial enterprises be allowed to utilize business models
which do not necessarily consist in providing services around free software. The more replaceable hooks you provide to filesystems and network stacks, the better.

You can still use *BSD, Windows, VxWorks or else, which are
very capable OSes. Nobody forces you to use Linux.

Quoted 1 line

S.N.

Jean

#9 lore raw
Quoted 11 lines · Jean Tourrilhes
Quoted 4 lines · Slavcho Nikolov

Unfortunately, I cannot assume that every L2 (or maybe I can, we'll see) is ethernet and I definitely cannot know in advance that every L3 is IP. Nor can the assumption be made that netfilter has been built into the kernel.

So, you thing assuming a modified netif_rx is different than
assuming netfilter support ?
Your idea is just too dangerous.

If you added something like this to netif_rx, I think it would accomplish the goals of those who want to add their own hooks. It would probably not please the folks who want to keep this code out for GPL/political/legal/moral reasons.

Note that the hook basically exists already in the bridging code. It may be illegal for GPL reasons to assign your own method to this hook, but I'm sure you could put up a good legal fight if you wanted to (the bridge hook is not exported GPL)

int netif_rx(struct sk_buff *skb)

{
	int this_cpu = smp_processor_id();
	struct softnet_data *queue;
	unsigned long flags;

+#idfef EVIL_COMPANY_NETWORK_HOOK_HACK
+ if (evil_hook) {
+ int rv = evil_hook(skb);
+ if (rv) { return; /* skb was consumed by evil hook, gawd help us all */ }
+ }
+#endif

	if (skb->stamp.tv_sec == 0)
		do_gettimeofday(&skb->stamp);
Quoted 9 lines
Quoted 7 lines

If I define my own private protocol handler (to catch all), I see cloned skb's
which is not what I want. I tried that and dropped each one of them in the handler, yet traffic continued to flow unimpeded (so I must have dropped clones).

Quoted 3 lines

For this to work, you need to modify the driver. The driver
generates a private packet type or protocol, and you will be the only to to catch it.

So, it would be ok to modify the driver to call a new hook, one that may be over-written by proprietary code? Otherwise, you have to write a non-gpl driver....yuck!

Thanks,
Ben

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#10 lore raw
In reply to Slavcho Nikolov
Quoted 5 lines · Slavcho Nikolov

As for GPL, I hope that commercial enterprises be allowed to utilize business models
which do not necessarily consist in providing services around free software. The more replaceable hooks you provide to filesystems and network stacks, the better.

While more hooks may be in your interest, they are not in the interest of free software.

I really hope you have competant legal advice for the things you are doing, because binary-only derivative works of a GPL work are illegal.

#11 lore raw
Quoted 2 lines · David S. Miller

I really hope you have competant legal advice for the things you are doing, because binary-only derivative works of a GPL work are illegal.

No. Distributing work based on GPL code binary-only without supplying the source and the modifications is (might be? is considered?) illegal. This is a major difference.

Else I'd have to delete some of the kernels running here, because I lost the sources for these. :-) (They're still running happily).

Regards
Henning

Signature · 5 lines
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     [email protected]

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   [email protected]
D-91054 Buckenhof     Fax.: 09131 / 50654-20   
#12 lore raw
Quoted 3 lines · Henning P. Schmiedehausen

Distributing work based on GPL code binary-only without supplying the source and the modifications is (might be? is considered?) illegal. This is a major difference.

That's what I meant.

Obviouslly this guy is intending to distribute his work though :)

#13 lore raw
Quoted 8 lines · David S. Miller
Quoted 3 lines · Henning P. Schmiedehausen

Distributing work based on GPL code binary-only without supplying the source and the modifications is (might be? is considered?) illegal. This is a major difference.

That's what I meant.

Obviouslly this guy is intending to distribute his work though :)

Fine, then we're in violent agreement. :-)

Regards
Henning

Signature · 5 lines
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     [email protected]

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   [email protected]
D-91054 Buckenhof     Fax.: 09131 / 50654-20   
#14 lore raw
In reply to David S. Miller

David Miller wrote

| While more hooks may be in your interest, they are not in the interest
| of free software.
| 
| I really hope you have competant legal advice for the things you are
| doing, because binary-only derivative works of a GPL work are illegal.

Thanks for the heads-up. What I propose to do is NOT to re-implement some existing linux routine by reusing all or some of its code. That is not only illegal, it's immoral.
In other words, the new routine will not be a derivative of the old one or some other part of the kernel.
Instead, I'll create my own (cleanroom) handler that doesn't reuse any existing code, which in the end will either pass control to the GPL routine being replaced or destroy the parameters and return.
I can't see how that is a violation of GPL. If it is, then hundreds of Linux startups had better go bankrupt now instead of fighting losing legal battles later.
S.N.

#15 lore raw
Quoted 8 lines · Slavcho Nikolov

In other words, the new routine will not be a derivative of the old one or some other part of the kernel.
Instead, I'll create my own (cleanroom) handler that doesn't reuse any existing code, which in the end will either pass control to the GPL routine being replaced or destroy the parameters and return.
I can't see how that is a violation of GPL. If it is, then hundreds of Linux startups had better go bankrupt now instead of fighting losing legal battles later.

Let me give you an example of what would be illegal.

Using this netif_rx() hook to implement a proprietary TCP stack to replace the GPL'd one in the kernel right now. And that is exactly the reason I want any such netif_rx function pointer crap to be EXPORT_GPL

And before someone, I forget who it was, barks again, EXPORT_GPL has no legal significance, it is merely an annotation. Whether a symbol is marked this way or not has no consequence on legal matters.