WEB开发网
开发学院软件开发C++ C语言EXPORT_SYMBOL_(INTERNAL and/or GPL) 阅读

C语言EXPORT_SYMBOL_(INTERNAL and/or GPL)

 2008-03-08 12:37:36 来源:WEB开发网   
核心提示:Submitted by Jeremy Andrews on Thursday, APRil 04, 2002 - 16:20 Another interesting debate recently ensued on the lkml, this time wi

  Submitted by Jeremy Andrews on Thursday, APRil 04, 2002 - 16:20

Another interesting debate recently ensued on the lkml, this time with kernel guru Alan Cox in the middle. The topic was related to the GPL (hence the emotions involved), though specifically referring to the changing of an EXPORT_SYMBOL_GPL flag to EXPORT_SYMBOL. Among the questions raised is whether this infringes upon a developer's rights...

MUCh of the debate follows, involving many kernel notables, including Andrea Arcangeli, Alan Cox, Rik van Riel, Ingo Molnar, and Linus Torvalds. Many good points are raised on both sides of the issue, making for an interesting read...

--------------------------------------------------------------------------------
From: Andrea Arcangeli
Cc: linux-kernel-mailing-list
Subject: Re: [PATCH 2.5.5] do export vmalloc_to_page to modules...
Date: Wed, 3 Apr 2002 18:21:18 +0200

On Wed, Feb 20, 2002 at 11:01:27AM -0500, Arjan van de Ven wrote:
> Now if it should be EXPORT_SYMBOL or EXPORT_SYMBOL_GPL() I leave to Ingo

It has to be EXPORT_SYMBOL. Requiring non GPL drivers to walk pagetables
by hand is pointless. we should definitely recommend those driver
authors to use vmalloc_to_page, in particular if the drivers are not
GPL.

To see it in another way If we make vmalloc_to_page linkable only by GPL
drivers, then we should do the same with all the other functionalities
too starting from map_user_kiobuf etc...

Infact I'm not really sure the _GPL tag makes sense in the first place.
If an interface shouldn't be used by a binary only module, why should it
be used by a GPL module? It doesn't make any sense to me, of course
I'm looking at it from a technical prospective. If your grand plan is to
forbid a non GPL module to call vmalloc/kmalloc/alloc_pages, then the
non GPL module developer will be in great pain I see, but that still
doesn't make any sense to me because the rule is that binary only
modules are legal. Not that I will ever use binary only modules myself,
not that I will ever do anything to help binary only modules, but I
don't either do anything to explicitly hurt them, I just ignore them.

--- 2.4.19pre5aa1/kernel/ksyms.c.~1~ Sun Mar 31 03:37:18 2002
+++ 2.4.19pre5aa1/kernel/ksyms.c Wed Apr 3 17:53:29 2002
@@ -114,7 +114,7 @@
EXPORT_SYMBOL(kfree);

EXPORT_SYMBOL(vfree);
EXPORT_SYMBOL(__vmalloc);
-EXPORT_SYMBOL_GPL(vmalloc_to_page);
+EXPORT_SYMBOL(vmalloc_to_page);
#ifndef CONFIG_DISCONTIGMEM
EXPORT_SYMBOL(contig_page_data);
EXPORT_SYMBOL(mem_map);
Andrea



From: Alan Cox
Subject: Re: [PATCH 2.5.5] do export vmalloc_to_page to modules...
Date: Wed, 3 Apr 2002 18:43:10 +0100 (BST)

> EXPORT_SYMBOL(vfree);
> EXPORT_SYMBOL(__vmalloc);
> -EXPORT_SYMBOL_GPL(vmalloc_to_page);
> +EXPORT_SYMBOL(vmalloc_to_page);

The authors of that code made it GPL. You have no right to change that. Its
exactly the same as someone taking all your code and making it binary only.

You are
- subverting a digital rights management system [5 years jail in the USA] - breaking a license


but worse than that you are ignoring the basic moral rights of the authors
of that code.

Alan



From: Andrea Arcangeli
Subject: Re: [PATCH 2.5.5] do export vmalloc_to_page to modules...
Date: Wed, 3 Apr 2002 20:13:22 +0200

On Wed, Apr 03, 2002 at 06:43:10PM +0100, Alan Cox wrote:
> The authors of that code made it GPL. You have no right to change that. Its
> exactly the same as someone taking all your code and making it binary only.
>
> You are
> - subverting a digital rights management system
> [5 years jail in the USA]
> - breaking a license
>
> but worse than that you are ignoring the basic moral rights of the authors
> of that code.

The vmalloc_to_page function is been patched into the kernel without any
special restriction or requirement for such code, there is not a single
comment about a change of licence (infact it's probably been cut and
pasted from one of the dozen of device drivers doing that by hand
previously, just changing the retval to a struct page, so changing the
licence would been probably illegal from your part in the first place).

Now from your comment it seems with your _GPL tag you meant to give
special licence to the function, that is not obvious at all, I don't
find it written anywhere, not even in your above email, so I recommend
you to licence your code properly ASAP if you don't want to use the
standard licence of the kernel code (like bsdcomp and other piece of
sourcecode deos).

Also please realize that you are ridicolous posting emails like the
above, any real lawyer will laught at you if you pretend me to go in
jail for 5 years in the US because you think such a "_GPL" four letters

in ksyms.c enforce in a court a different licence in a function in
memory.c covered by the usual kernel license (like map_user_kiobuf),
despite there is not a single line of english out there written by the
author to confirm your assumption. Not even a kernel hacker can guess
you meant to change the licence of the code if you don't even write a
line about a change of licence anywhere, period. Not even there is
written anywhere in the kernel that such _GPL tags are meant to change
the licence.

Infact it's the other way around, if the author of vmalloc_to_page
wanted really to change the licence as it seems while reading your above
email (not confirmed yet), as soon as he documents his request properly,
I will tell him that I refuse him to do that, I'm one of the authors of
memory.c so that is my right to enforce it, as it was my right for Linus
to refuse my code if I wanted to use a difference licence. The reason I
refuse a change of licence for a basic functionality in memory.c, is
that those are lawyers tricks that can only hurt linux. If everybody
that writes a function starts crying like you did above it will be a
true mess, and at the very least such kind of tricks should be put in a
separate file.

So if you want to change the module licensing and avoid binary only
drivers, go and ask all the copyright holders to agree on that, once you
have the agreement Linus can release a new kernel tarball with the new
licence for all the normal kernel code, i.e. pure GPL. But for the core
kernel code it must be possible to intermix it without worrying about
licensing issues, so no special licences within memory.c, I will enforce
that, period.

If there's any expert out there that can check the correctness of what I
said I'd be grateful, thanks.

Andrea



From: Alan Cox
Subject: Re: [PATCH 2.5.5] do export vmalloc_to_page to modules...
Date: Wed, 3 Apr 2002 20:11:49 +0100 (BST)

> The vmalloc_to_page function is been patched into the kernel without any
> special restriction or requirement for such code, there is not a single

Untrue

Tags:语言 EXPORT SYMBOL

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接