History

module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity

The original MODULE_LICENSE string for kernel modules licensed under the GPL v2 (only / or later) was simply "GPL", which was - and still is - completely sufficient for the purpose of module loading and checking whether the module is free software or proprietary. In January 2003 this was changed with commit 3344ea3ad4b7 ("[PATCH] MODULE_LICENSE and EXPORT_SYMBOL_GPL support"). This commit can be found in the history git repository which holds the 1:1 import of Linus' bitkeeper repository: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=3344ea3ad4b7c302c846a680dbaeedf96ed45c02 The main intention of the patch was to refuse linking proprietary modules against symbols exported with EXPORT_SYMBOL_GPL() at module load time. As a completely undocumented side effect it also introduced the distinction between "GPL" and "GPL v2" MODULE_LICENSE() strings: * "GPL" [GNU Public License v2 or later] * "GPL v2" [GNU Public License v2] * "GPL and additional rights" [GNU Public License v2 rights and more] * "Dual BSD/GPL" [GNU Public License v2 * or BSD license choice] * "Dual MPL/GPL" [GNU Public License v2 * or Mozilla license choice] This distinction was and still is wrong in several aspects: 1) It broke all modules which were using the "GPL" string in the MODULE_LICENSE() already and were licensed under GPL v2 only. A quick license scan over the tree at that time shows that at least 480 out of 1484 modules have been affected by this change back then. The number is probably way higher as this was just a quick check for clearly identifiable license information. There was exactly ONE instance of a "GPL v2" module license string in the kernel back then - drivers/net/tulip/xircom_tulip_cb.c which otherwise had no license information at all. There is no indication that the change above is any way related to this driver. The change happend with the 2.4.11 release which was on Oct. 9 2001 - so quite some time before the above commit. Unfortunately there is no trace on the intertubes to any discussion of this. 2) The dual licensed strings became ill defined as well because following the "GPL" vs. "GPL v2" distinction all dual licensed (or additional rights) MODULE_LICENSE strings would either require those dual licensed modules to be licensed under GPL v2 or later or just be unspecified for the dual licensing case. Neither choice is coherent with the GPL distinction. Due to the lack of a proper changelog and no real discussion on the patch submission other than a few implementation details, it's completely unclear why this distinction was introduced at all. Other than the comment in the module header file exists no documentation for this at all. From a license compliance and license scanning POV this distinction is a total nightmare. As of 5.0-rc2 2873 out of 9200 instances of MODULE_LICENSE() strings are conflicting with the actual license in the source code (either SPDX or license boilerplate/reference). A comparison between the scan of the history tree and a scan of current Linus tree shows to the extent that the git rename detection over Linus tree grafted with the history tree is halfways complete that almost none of the files which got broken in 2003 have been cleaned up vs. the MODULE_LICENSE string. So subtracting those 480 known instances from the conflicting 2800 of today more than 25% of the module authors got it wrong and it's a high propability that a large portion of the rest just got it right by chance. There is no value for the module loader to convey the detailed license information as the only decision to be made is whether the module is free software or not. The "and additional rights", "BSD" and "MPL" strings are not conclusive license information either. So there is no point in trying to make the GPL part conclusive and exact. As shown above it's already non conclusive for dual licensing and incoherent with a large portion of the module source. As an unintended side effect this distinction causes a major headache for license compliance, license scanners and the ongoing effort to clean up the license mess of the kernel. Therefore remove the well meant, but ill defined, distinction between "GPL" and "GPL v2" and document that: - "GPL" and "GPL v2" both express that the module is licensed under GPLv2 (without a distinction of 'only' and 'or later') and is therefore kernel license compliant. - None of the MODULE_LICENSE strings can be used for expressing or determining the exact license - Their sole purpose is to decide whether the module is free software or not. Add a MODULE_LICENSE subsection to the license rule documentation as well.

Thomas Gleixner committed 7 years ago

Commit bf7fbee1 parent de190552 files · +79 −1Browse files

Unified · Split

2 files
  1. Documentation/process/license-rules.rst +62 −0
  2. include/linux/module.h +17 −1
Documentation/process/license-rules.rst+62−0
@@ -372,3 +372,65 @@ in the LICENSE subdirectories. This is required to allow tool · 371 unmodified lines
372verification (e.g. checkpatch.pl) and to have the licenses ready to read372verification (e.g. checkpatch.pl) and to have the licenses ready to read
373and extract right from the source, which is recommended by various FOSS373and extract right from the source, which is recommended by various FOSS
374organizations, e.g. the `FSFE REUSE initiative <https://reuse.software/>`_.374organizations, e.g. the `FSFE REUSE initiative <https://reuse.software/>`_.
375
376_`MODULE_LICENSE`
377-----------------
378
379 Loadable kernel modules also require a MODULE_LICENSE() tag. This tag is
380 neither a replacement for proper source code license information
381 (SPDX-License-Identifier) nor in any way relevant for expressing or
382 determining the exact license under which the source code of the module
383 is provided.
384
385 The sole purpose of this tag is to provide sufficient information
386 whether the module is free software or proprietary for the kernel
387 module loader and for user space tools.
388
389 The valid license strings for MODULE_LICENSE() are:
390
391 ============================= =============================================
392 "GPL" Module is licensed under GPL version 2. This
393 does not express any distinction between
394 GPL-2.0-only or GPL-2.0-or-later. The exact
395 license information can only be determined
396 via the license information in the
397 corresponding source files.
398
399 "GPL v2" Same as "GPL". It exists for historic
400 reasons.
401
402 "GPL and additional rights" Historical variant of expressing that the
403 module source is dual licensed under a
404 GPL v2 variant and MIT license. Please do
405 not use in new code.
406
407 "Dual MIT/GPL" The correct way of expressing that the
408 module is dual licensed under a GPL v2
409 variant or MIT license choice.
410
411 "Dual BSD/GPL" The module is dual licensed under a GPL v2
412 variant or BSD license choice. The exact
413 variant of the BSD license can only be
414 determined via the license information
415 in the corresponding source files.
416
417 "Dual MPL/GPL" The module is dual licensed under a GPL v2
418 variant or Mozilla Public License (MPL)
419 choice. The exact variant of the MPL
420 license can only be determined via the
421 license information in the corresponding
422 source files.
423
424 "Proprietary" The module is under a proprietary license.
425 This string is solely for proprietary third
426 party modules and cannot be used for modules
427 which have their source code in the kernel
428 tree. Modules tagged that way are tainting
429 the kernel with the 'P' flag when loaded and
430 the kernel module loader refuses to link such
431 modules against symbols which are exported
432 with EXPORT_SYMBOL_GPL().
433 ============================= =============================================
434
435
436
include/linux/module.h+17−1
@@ -172,7 +172,7 @@ extern void cleanup_module(void); · 171 unmodified lines
172 * The following license idents are currently accepted as indicating free172 * The following license idents are currently accepted as indicating free
173 * software modules173 * software modules
174 *174 *
175 * "GPL" [GNU Public License v2 or later]175 * "GPL" [GNU Public License v2]
176 * "GPL v2" [GNU Public License v2]176 * "GPL v2" [GNU Public License v2]
177 * "GPL and additional rights" [GNU Public License v2 rights and more]177 * "GPL and additional rights" [GNU Public License v2 rights and more]
178 * "Dual BSD/GPL" [GNU Public License v2178 * "Dual BSD/GPL" [GNU Public License v2
@@ -186,6 +186,22 @@ extern void cleanup_module(void); · 7 unmodified lines
186 *186 *
187 * "Proprietary" [Non free products]187 * "Proprietary" [Non free products]
188 *188 *
189 * Both "GPL v2" and "GPL" (the latter also in dual licensed strings) are
190 * merely stating that the module is licensed under the GPL v2, but are not
191 * telling whether "GPL v2 only" or "GPL v2 or later". The reason why there
192 * are two variants is a historic and failed attempt to convey more
193 * information in the MODULE_LICENSE string. For module loading the
194 * "only/or later" distinction is completely irrelevant and does neither
195 * replace the proper license identifiers in the corresponding source file
196 * nor amends them in any way. The sole purpose is to make the
197 * 'Proprietary' flagging work and to refuse to bind symbols which are
198 * exported with EXPORT_SYMBOL_GPL when a non free module is loaded.
199 *
200 * In the same way "BSD" is not a clear license information. It merely
201 * states, that the module is licensed under one of the compatible BSD
202 * license variants. The detailed and correct license information is again
203 * to be found in the corresponding source files.
204 *
189 * There are dual licensed components, but when running with Linux it is the205 * There are dual licensed components, but when running with Linux it is the
190 * GPL that is relevant so this is a non issue. Similarly LGPL linked with GPL206 * GPL that is relevant so this is a non issue. Similarly LGPL linked with GPL
191 * is a GPL combined work.207 * is a GPL combined work.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t