Tainting kernels for non-GPL or forced modules
I have started work on the patch for /proc/sys/kernel/tainted with the corresponding modutils and ksymoops changes. insmod of a non-GPL module ORs /proc/sys/kernel/tainted with 1, insmod -f ORs with 2.
What to do about modules with no license? Complain and taint or silently ignore? A lot of modules in -ac14 have no MODULE_LICENSE, probably because they have no MODULE_AUTHOR. IMHO the default should be complain and taint, even though it will generate lots of newbie questions to l-k.
Quoted 2 lines · Keith Owens
IMHO the default should be complain and taint, even though it will generate lots of newbie questions to l-k.
Wasn't it those questions that this feature was meant to prevent in the first place?
Signature · 1 line
André Dahlqvist <[email protected]>
Quoted 7 lines · Andr? Dahlqvist
Quoted 2 lines · Keith Owens
IMHO the default should be complain and taint, even though it will generate lots of newbie questions to l-k.
Wasn't it those questions that this feature was meant to prevent in the first place?
Er, I thought the whole point of this was so that we would know if the kernel had been 'tainted' by a non-free module that we can't debug.
Signature · 2 lines
Tom Rini (TR1265) http://gate.crashing.org/~trini/
Quoted 5 lines
What to do about modules with no license? Complain and taint or silently ignore? A lot of modules in -ac14 have no
MODULE_LICENSE, probably because they have noMODULE_AUTHOR. IMHO the default should be complain and taint, even though it will generate lots of newbie questions to l-k.
I still have many to do. What would help me no end would be a version of depmod or similar which warned about modules with
o No description
o No author
o No license tag
Then we can stage a concerted clean up run
Alan
Quoted 6 lines · Alan Cox
I still have many to do. What would help me no end would be a version of depmod or similar which warned about modules with
o No description
o No author
o No license tag
/sbin/modinfo $(find /lib/modules/uname -r -name '*.o') lists filename, description, author, license and parms, in that order. Extracting entries marked <none> is left as an exercise for the reader. License is printed by modutils >= 2.4.9 (not released yet) or the patch below against 2.4.8.
Index: 9.1/insmod/modinfo.c
insmod/modinfo.c Sat, 22 Sep 2001 23:17:01 +1000 kaos (modutils-2.4/b/9_modinfo.c 1.6 644) renamed from insmod/modinfo.c Wed, 28 Mar 2001 20:49:06 +1000 kaos (modutils-2.4/b/9_modinfo.c 1.6 644) +17 -3
@@ -31,6 +31,8 @@ * Keith Owens <[email protected]> December 1999. * Print " persistent" for persistent parameters. * Keith Owens <[email protected]> November 2000. + * License support. + * Keith Owens <[email protected]> September 2001. */ #ident "$Id$"
@@ -249,6 +251,11 @@ static char *format_query_string(struct &out_str, last_char - out_str, 0); break; + case 'l': + (void) append_modinfo_tag(f, "license", "<none>", + &out_str, last_char - out_str, 1); + break; + case '{':{ char tag[128], *end = strchr(in_str, '}'); int multi_line;
@@ -267,7 +274,8 @@ static char *format_query_string(struct strncpy(tag, in_str, end - in_str); tag[end - in_str] = '\0'; multi_line = strcmp(tag, "author") == 0 || - strcmp(tag, "description") == 0; + strcmp(tag, "description") == 0 || + strcmp(tag, "license") == 0; /* Append the tag's value if it exists. */ append_modinfo_tag(f, tag, "<none>", &out_str, last_char - out_str, multi_line);
@@ -479,6 +487,7 @@ void modinfo_usage(void) printf("usage: modinfo <options> <module>\n"); printf(" -a, --author display module author\n"); printf(" -d, --description display module description\n"); + printf(" -l, --license display module license\n"); printf(" -n, --filename display module filename\n"); printf(" -f <str>\n"); printf(" --format <str> print the <query-string>\n");
@@ -499,6 +508,7 @@ int main(int argc, char *argv[]) { {"author", 0, 0, 'a'}, {"description", 0, 0, 'd'}, + {"license", 0, 0, 'l'}, {"filename", 0, 0, 'n'}, {"format", required_argument, 0, 'f'}, {"parameters", 0, 0, 'p'},
@@ -507,9 +517,9 @@ int main(int argc, char *argv[]) {0, 0, 0, 0} }; int do_parameters = 1, opt; - char *fmtstr = "filename: %n\ndescription: %d\nauthor: %a\n"; + char *fmtstr = "filename: %n\ndescription: %d\nauthor: %a\nlicense: %l\n"; - while ((opt = getopt_long(argc, argv, "adnq:pf:Vh", long_opts, NULL)) != EOF) + while ((opt = getopt_long(argc, argv, "adlnq:pf:Vh", long_opts, NULL)) != EOF) switch (opt) { case 'a': fmtstr = "%a\n";
@@ -517,6 +527,10 @@ int main(int argc, char *argv[]) break; case 'd': fmtstr = "%d\n"; + do_parameters = 0; + break; + case 'l': + fmtstr = "%l\n"; do_parameters = 0; break; case 'n':
Quoted 3 lines · Keith Owens
I have started work on the patch for
/proc/sys/kernel/taintedwith the corresponding modutils and ksymoops changes. insmod of a non-GPL module ORs/proc/sys/kernel/taintedwith 1, insmod -f ORs with 2.
So now these will taint the kernel?
LGPL
2-clause BSD
X11
public domain
They are all non-GPL.
Quoted 5 lines
What to do about modules with no license? Complain and taint or silently ignore? A lot of modules in -ac14 have no
MODULE_LICENSE, probably because they have noMODULE_AUTHOR. IMHO the default should be complain and taint, even though it will generate lots of newbie questions to l-k.
Give them separate bits.
0x00000001 unknown license0x00000002 fully GPL-compatible license (GPL, LGPL, 2-clause BSD, X11) 0x00000004 other certified "Open Source" license (MPL, 4-clause BSD) 0x00000008 source available, but w/o certified "Open Source" licensing 0x00000010 no source available0x00000020 non-redistributable binary0x10000000 any module at all (prove that user did load a module) 0x20000000 insmod -f0x40000000 hacked in, using System.map0x80000000 hacked in with unresolved references
Quoted 11 lines · Albert D. Cahalan
Quoted 3 lines · Keith Owens
I have started work on the patch for
/proc/sys/kernel/taintedwith the corresponding modutils and ksymoops changes. insmod of a non-GPL module ORs/proc/sys/kernel/taintedwith 1, insmod -f ORs with 2.So now these will taint the kernel?
LGPL
2-clause BSD
X11
public domain
No, the list of GPL licenses is taken from include/linux/module.h, q.v.
Quoted 3 lines · Keith Owens
I have started work on the patch for
/proc/sys/kernel/taintedwith the corresponding modutils and ksymoops changes. insmod of a non-GPL module ORs/proc/sys/kernel/taintedwith 1, insmod -f ORs with 2.
Where can I find more information about this? The word "tainted" doesn't appear in my kernel source code (I guess 2.4.2 is too old), and a search on google didn't reveal anything.
The reason I ask is because I'm working on a closed-source (unfortunately) driver for Linux, and I'd really like to make it behave as well as possible.
Quoted 9 lines · Timur Tabi
Quoted 3 lines · Keith Owens
I have started work on the patch for
/proc/sys/kernel/taintedwith the corresponding modutils and ksymoops changes. insmod of a non-GPL module ORs/proc/sys/kernel/taintedwith 1, insmod -f ORs with 2.Where can I find more information about this? The word "tainted" doesn't appear in my kernel source code (I guess 2.4.2 is too old), and a search on google didn't reveal anything.
http://marc.theaimsgroup.com/?l=linux-kernel&m=99922065229945&w=2 and the rest of the thread.
Quoted 2 lines
The reason I ask is because I'm working on a closed-source (unfortunately) driver for Linux, and I'd really like to make it behave as well as possible.
Add a
MODULE_LICENSE("(c) copyright foo, readers will be mangled with the DMCA")
or appropriate tag to it.
That tag is read by modutils (and ignored by older ones) and tells it the code is non free.
Nvidia asked about the MODULE_LICENSE tag code being GPL so to make them happy I also released it as below to avoid any confusion
Alan
--
Alan Cox hereby grants all parties the right to use and distribute his MODULE_LICENSE() macro in both source and binary forms, for the purpose of identifying the license on software
Subject to the follow conditions:
* The name of the author may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
NO WARRANTY
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Quoted 2 lines · Timur Tabi
The reason I ask is because I'm working on a closed-source (unfortunately) driver for Linux, and I'd really like to make it behave as well as possible.
add to your module code :
MODULE_LICENSE("TabiPL");
(or whatever it is).
That way the kernel maintainers can ignore any bugs reported with your module loaded easily.
regards
john
Signature · 2 lines
"Khendon's Law: If the same point is made twice by the same person, the thread is over."