Kernel Modules and the GPL.
Homepage: webng.com/linuxhelp


Kernel Modules and the GPL
(General Public License)


I thought I would toss in my two pennies worth.

To help focus ones ideas, I will attempt to define the terms.

An application module is a compiled section of code that can be linked to an application.
A collection of application modules is called an application library.

Since application libraries are often used, or shared, by many different applications, they are commonly called shared libraries.

We will call an application, together with its application libraries, a program.

A kernel is a distinguished application/program which communicates with the hardware.

A kernel module is a compiled section of code that can be linked to the kernel.
A collection of kernel modules is called a kernel library.

One should note that the division between applications and application libraries is rather flexible, and is largely a matter of definition.

To see this, we can write a program that does not link to any application libraries at all. This program is all application. We can then take this very same program and define it to be a new application library. To this we add a few lines of code to initiate, or call, the library. These few lines of code will be the new application. This second representation of the program is essentially all application library.

Both of the above are simply different ways of presenting the same program.

The GPL (General Public License) is a software license originally written by Richard Stallman.

You can find a copy of it at http://www.opensource.org/licenses/gpl-license.php

The above mentioned possibility of hiding the entire code of a program as an application library, is the reason that the GPL demands that any application that links to GPL'd shared libraries, must itself be GPL'd (a program is GPL'd, if it is licensed under the GPL).

It has been claimed that distributing a GPL'd kernel with binary closed source kernel modules is illegal. This claim has been advanced, to stop Linux distributors from shipping with Nvidia and ATI drivers that work "straight out of the box". A recent example of this is the Kororaa controversy.

Those wishing to cripple Linux, make many unsubstantiated claims, many of which are wrong, in order to prevent Linux distributors shipping Nvidia and ATI drivers that work "out of the box". Here is a sample:

1) GPL and non-GPL components cannot be included together on a CD.
2) Closed source kernel modules, distributed with a GPL'd kernel, clearly violate the GPL.
3) Don't include closed source kernel modules as the situation is murky. You might get sued.
4) Closed source kernel modules link to the kernel in the same way that applications link to libraries, therefore you cannot include them with a GPL'd kernel.


One, is wrong. Two, is not clear at all. Three, which sounds correct, is also wrong. Think about it, who is going to sue you? The Free Software Foundation? Not likely. Perhaps Microsoft might be interested in enforcing the GPL. Four, seems to have some merit, but is wrong.

Since linking is a two-way process, Four, should really be stated as follows: A kernel links to closed source kernel modules in the same way that applications link to application libraries, therefore you cannot include closed source kernel modules with a GPL'd kernel.

Remember, the GPL states that:

An application that links to a GPL'd application module or library, must itself be GPL'd.

Applying the GPL to kernels and kernel modules, we have:

A kernel that links to a GPL'd kernel module or library, must itself be GPL'd.

So, it becomes clear that the conclusion drawn in Four, is just plain wrong, and thus says nothing about the legality of including closed source kernel modules and GPL'd kernels.

That kernel developers envisage a mixture of proprietary and free kernel modules is very apparent from this passage in the kernel source code file, module.h.



The header file module.h can be found at /usr/src/linux/include/linux/module.h

 CONCLUSION 

In conclusion, it seems that there is no reasonable argument against including closed source kernel modules with Linux distributions, whenever useful.

In particular, there seems to be no reasonable argument against including Nvidia and ATI drivers with Linux distributions in such a way that they work "straight out of the box".

 FOLLOW UP TO THE ABOVE ARTICLE 

The following is comment from the forum linux.coconia.net/forum/viewtopic.php?id=20

[David Lynch] "But unless you are an intellectual property attorney or the author of the GPL you would not qualify as an expert on what licenses mean."

TRUE. This won't stop me offering opinions though.

[David Lynch] "I suspect that RMS would disagree with you on a number of points,...."

Possible, but Stallman sees no (legal) problem with including closed source kernel modules.

[Richard Stallman] "So what did Sun actually do? It allowed more convenient redistribution of the binaries of its Java platform. With this change, GNU/Linux distros CAN INCLUDE the non-free Sun Java platform, just as some now include the non-free nVidia driver. But they do so only at the cost of being non-free."

http://www.groklaw.net/article.php?story=20060524112209579

So Richard Stallman sees exactly no legal violation of the GPL. Clearly including the nVidia driver makes the collection non-free, but NOT illegal.

[David Lynch] "Further, whether it violates the letter of the GPL it violates the spirit. Nvidia or any other vendor is perfectly entitled to support or not support Linux. But they are not entitled to violate the license of the OS to do so."

Nvidia and ATI etc, DO NOT VIOLATE THE GPL,.... they do not even violate it in spirit,... you are free to use proprietary software if you wish.

[David Lynch] "The principle behind the GPL is NOT that all software must be Open Source. But it is that if you build on GPL'd software then your software must be GPL'd also - there is no free ride for properitary software."

Yes, I agree. There is a little looseness in the phrase "building on GPL'd software". I take it to mean that it must not incorporate, or be derived from, GPL'd code, without its code also being released (code that is derived from GPL'd code, but has been significantly changed, is a problem that one can't do much about).

There is also significant looseness in the term "linking" and it would be helpful to differentiate between various varieties of linking and to provide clear definitions of such.

Linking to independently written code is not considered building on GPL'd code. For example, every single binary (apart from the kernel itself) links to the kernel. Every single binary repeatedly calls the kernel to regulate communication with the hardware, etc. This type of linking of open or CLOSED SOURCE binaries to the GPL'd kernel is fine and no one (who has a clue) claims otherwise.

Using Linux kernel-header-files is NOT considered stealing GPL'd code. These are the instruction files, telling a program how it should link to the kernel. It is vital that all programs (proprietary or free) talk, or link, to the kernel in this way.

For example, when Adobe Acrobat Reader is compiled for Windows it uses Windows-header-files to establish the necessary linkage to the Windows kernel. This linkage to the Windows kernel does not imply that Adobe Acrobat Reader is violating Microsoft's copyright, or licenses, any more than Adobe Acrobat Reader violates the GPL when it compiles against Linux-kernel-header-files in order to communicate with the Linux kernel.

The Linux kernel interface is absolutely necessary for programs to talk, or link, to the kernel. A program that cannot link to the kernel is clearly totally worthless.

Linux people are demanding that Microsoft open up its APIS, etc, it would not make sense to make it illegal to use the Linux equivalent.


[David Lynch] "The LGPL exists for those situations where it was deemed valid to allow proprietary software to use resources provided by Free Software."

Every piece of software (proprietary or free) uses the Free Software resource known as the Linux kernel. So the LGPL is not for the purpose you claim.

Every Linux system links to the CLOSED SOURCE BIOS software on your computers motherboard. By the way, do you see the use of this closed source BIOS as a moral issue? Will you be scrapping your computer and looking for a new one with open source firmware?

And what about the firmware of your hard disk, or of your PCI cards, or your graphics cards?


[David Lynch] "Your source examples are just exactly that - they describe how other Open Source Modules can be incorporated into the Kernel without necessarily being released under the GPL - but it still requires a source distribution."

Actually, they are meant to describe how CLOSED SOURCE modules can be incorporated with the Kernel without necessarily being released under the GPL. Something like the way that the closed source BIOS is linked into every Linux system (with hardly anyone complaining).

[David Lynch] "Further, the GPL has NEVER prohibited developing proprietary solutions using GPL'd resources. What it prohibits is distributing them."

As mentioned above, it is fine to USE GPL'd resources, as long as you do not incorporate/steal GPL'd code (whether you distribute it or not).

[David Lynch] "Finally all this and more has been debated on LKML for a long time."

Maybe, but such discussion is diffuse and because there are so many different opinions people often leave as confused as they were at the beginning. The LKML is not a good venue for such discussion.

I signed up for the forum at http://kerneltrap.org/, published once and was not allowed to publish again, but I guess that is another story.


[David Lynch] "There may not be an absolute consensus, but the normal view of Linux Kernel developers is this violates their intentions. Facilities have been added to the Kernel to explicity prohibit this and many other similar scenarios, and those features are gradually being enabled."

Do you really have a clue as to how Linux Kernel developers think? Why does it violate their intentions? What are their intentions? Are you assuming they all think like you?

[David Lynch] "You are correct that it does not appear to be absolutely clear in the strictest legal sense that the GPL prohibits this. But there is no doubt the spirit of the GPL does, nor is there any doubt that Linux has gone to a fair amount of trouble to make exactly this difficult and will continue to do so."

Whether one thinks it is against the spirit of the GPL, or not, depends on what they believe the intent of the writers (Stallman etc) was, not on the legal situation. This is clearly subjective and no one can accurately guess the intention of all the writers. One cannot even accurately guess Stallman's intent, although one assumes one has a reasonable idea.

[David Lynch] "But there is no doubt the spirit of the GPL does, nor is there any doubt that Linux has gone to a fair amount of trouble to make exactly this difficult"

You might be surprised to learn that it is not "Linux" that has gone to a fair amount of trouble to make this difficult.

The spirit of the GPL is irrelevant. The GPL is a legal document, not a piece of poetry.

Legally, the GPL allows one to use closed source modules, so one should use them whenever useful.

Remember, if Linux is easier to use, more people will use it, more developers will use and code for it, more GPL'd software will be produced.

Conversely, if Linux is harder to use, less people will use it, less developers will use and code for it, less GPL'd software will be produced.