Loadable Kernel Modules are user written software which tightly binds with the operating system kernel and runs in the same address space as the kernel. This requires calls to the kernel using specially defined kernel functions.
From the point of view of the commercial software developer that develops the “user” written software, LKMs bind to the kernel in order to improve execution speed and resource consumption. From the point of view of the kernel developer, at least in the case of the Linux kernel, the user written software is extending the function of the kernel, is based on the kernel, and is basically a derivative work of the kernel.
This difference in point of view is leading to a disagreement about open source licenses. which increases the legal risk for commercial developers who develop software that runs on Linux, and which is implemented as Loadable Kernel Modules.
Basically, the Free Software Foundation argues that since the Linux kernel is licensed under GPL. And since the user software that is implemented as a Loadable Kernel Module is based on the Linux kernel. The user code should also be licensed under the GPL and given away as open source. Also, any user code that is statically linked to the Loadable Kernel Module should also be licensed under GPL. The FSF believes this is an especially strong argument. Because the calls to the Linux kernel that enable Loadable Kernel Modules are labeled as “GPL only”. So the user that implements Loadable Kernel Modules is implicitly agreeing to the GPL licensing requirement.
Many commercial software developers argue. That this user written Loadable Kernel Module is not based on Linux or a derivative of Linux. But is separate and independent and they should not be compelled to license it under GPL. They would further argue that their user code runs on several kernels,and isn’t dependent on the Linux kernel in particular.
Regardless of which side of that legal issue you are on. You can see the potential for significant legal risk with alarming viral implications.
At Source Auditor, we believe it is best to:
- not implement user code as a LKM, if working on top of Linux
- for user code that must be developed as LKMs on top of Linux (this is often required of device drivers). The commercial software developer has to accept the strong possibility. That their LKMs will need to be open sourced under GPL.
- for user code that must be developed as LKMs on top of Linux. These should be isolated, ie, not statically linked to your other code. There are “glue code” models that can be used for this.
- your existing source code should be audited for LKM implementations. These are easy to spot as the calls to the Linux kernel are well defined.