public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Blacklist binary-only modules lying about their license
@ 2004-04-27  2:09 Carl-Daniel Hailfinger
  2004-04-27  3:13 ` Gilles May
                   ` (3 more replies)
  0 siblings, 4 replies; 150+ messages in thread
From: Carl-Daniel Hailfinger @ 2004-04-27  2:09 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linus Torvalds, Andrew Morton, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

Hi,

LinuxAnt offers binary only modules without any sources. To circumvent our
MODULE_LICENSE checks LinuxAnt has inserted a "\0" into their declaration:

MODULE_LICENSE("GPL\0for files in the \"GPL\" directory; for others, only
LICENSE file applies");

Since string comparisons stop at the first "\0" character, the kernel is
tricked into thinking the modules are GPL. Btw, the "GPL" directory they
are speaking about is empty.

The attached patch blacklists all modules having "Linuxant" or "Conexant"
in their author string. This may seem a bit broad, but AFAIK both
companies never have released anything under the GPL and have a strong
history of binary-only modules.


Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/

[-- Attachment #2: module_blacklist.diff --]
[-- Type: text/plain, Size: 1808 bytes --]

--- linux-2.6.5/kernel/module.c~	2004-04-04 05:37:37.000000000 +0200
+++ linux-2.6.5/kernel/module.c	2004-04-27 01:24:14.000000000 +0200
@@ -34,6 +34,7 @@
 #include <linux/vermagic.h>
 #include <linux/notifier.h>
 #include <linux/stop_machine.h>
+#include <linux/string.h>
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #include <asm/pgalloc.h>
@@ -1112,6 +1113,14 @@
 	}
 }
 
+static inline int license_author_is_not_blacklisted(const char *author)
+{
+	/* LinuxAnt is known to ship non-GPL modules with license=="GPL"
+	   to cheat on our checks. Stop them from doing that. */
+	return !(strstr(author, "Linuxant")
+		|| strstr(author, "Conexant"));
+}
+
 static inline int license_is_gpl_compatible(const char *license)
 {
 	return (strcmp(license, "GPL") == 0
@@ -1121,12 +1130,16 @@
 		|| strcmp(license, "Dual MPL/GPL") == 0);
 }
 
-static void set_license(struct module *mod, const char *license)
+static void set_license(struct module *mod, const char *license,
+			const char *author)
 {
 	if (!license)
 		license = "unspecified";
+	if (!author)
+		author = "unspecified";
 
-	mod->license_gplok = license_is_gpl_compatible(license);
+	mod->license_gplok = license_is_gpl_compatible(license)
+				&& license_author_is_not_blacklisted(author);
 	if (!mod->license_gplok) {
 		printk(KERN_WARNING "%s: module license '%s' taints kernel.\n",
 		       mod->name, license);
@@ -1466,7 +1479,8 @@
 	module_unload_init(mod);
 
 	/* Set up license info based on the info section */
-	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
+	set_license(mod, get_modinfo(sechdrs, infoindex, "license"),
+			get_modinfo(sechdrs, infoindex, "author"));
 
 	/* Fix up syms, so that st_value is a pointer to location. */
 	err = simplify_symbols(sechdrs, symindex, strtab, versindex, pcpuindex,

^ permalink raw reply	[flat|nested] 150+ messages in thread
* Re: [PATCH] Blacklist binary-only modules lying about their license
@ 2004-04-27 13:43 Albert Cahalan
  2004-04-27 16:18 ` Jon
  0 siblings, 1 reply; 150+ messages in thread
From: Albert Cahalan @ 2004-04-27 13:43 UTC (permalink / raw)
  To: linux-kernel mailing list
  Cc: c-d.hailfinger.kernel.2004, gilles, zwane, torvalds, rusty,
	jbglaw, willy

I don't see a need to get all complicated about this.
This is simple, really: since a C string ends at the
'\0', the module has been declared to be GPL code.
We shouldn't care if that C string is part of a larger
array. This is a damn obvious case of willful circumvention
of copyright control, access control, digital rights
management, etc.

Unleash the sharks.



^ permalink raw reply	[flat|nested] 150+ messages in thread

end of thread, other threads:[~2004-05-10  7:07 UTC | newest]

Thread overview: 150+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-27  2:09 [PATCH] Blacklist binary-only modules lying about their license Carl-Daniel Hailfinger
2004-04-27  3:13 ` Gilles May
2004-04-27  4:42   ` Zwane Mwaikambo
2004-04-27  9:58     ` Carl-Daniel Hailfinger
2004-04-27  4:31 ` Linus Torvalds
2004-04-27  6:04   ` Rusty Russell
2004-04-27  9:21     ` Jan-Benedict Glaw
2004-04-27 10:37       ` Carl-Daniel Hailfinger
2004-04-27 12:59         ` Paulo Marques
2004-04-27 13:12           ` [PATCH] Blacklist binary-only modules lying about their license (-> possible GPL violation :) Jan-Benedict Glaw
2004-04-27 14:10             ` Tim Connors
2004-04-27 17:05           ` [PATCH] Blacklist binary-only modules lying about their license Juergen E. Fischer
2004-04-27 18:58           ` Pavel Machek
2004-04-28 22:55             ` Timothy Miller
     [not found]           ` <fa.f05evul.1qmg8gd@ifi.uio.no>
2004-04-27 21:17             ` Junio C Hamano
2004-04-27 21:33               ` Valdis.Kletnieks
2004-04-28 23:24           ` Rik van Riel
2004-04-27 18:52   ` Pavel Machek
2004-04-27  5:26 ` Willy Tarreau
2004-04-27  7:03   ` Grzegorz Piotr Jaskiewicz
2004-04-29 18:40 ` [hsflinux] " Giuliano Colla
2004-04-29 19:08   ` viro
2004-04-29 19:29     ` Måns Rullgård
2004-04-29 20:24   ` Timothy Miller
2004-04-29 21:32     ` Marc Boucher
2004-04-29 22:12       ` Timothy Miller
2004-04-29 22:20         ` Marc Boucher
2004-04-29 23:01           ` Timothy Miller
2004-04-30  6:01             ` Matthias Schniedermeyer
2004-04-30  9:33               ` Symbios and BIOS (was: Re: [PATCH] Blacklist binary-only modules lying about their license) Geert Uytterhoeven
2004-04-30 11:07                 ` Matthias Schniedermeyer
2004-05-06 15:06       ` [PATCH] Blacklist binary-only modules lying about their license Pavel Machek
2004-04-29 21:10   ` [hsflinux] " Linus Torvalds
2004-04-29 21:44     ` viro
2004-04-30 13:37     ` Giuliano Colla
2004-04-30 14:14       ` Arthur Perry
2004-04-30 18:14         ` Giuliano Colla
2004-04-30 15:55       ` Carl-Daniel Hailfinger
2004-04-30 19:27         ` Giuliano Colla
2004-04-30 20:29           ` Timothy Miller
2004-05-02  8:40           ` Geert Uytterhoeven
2004-05-02 22:26             ` Giuliano Colla
2004-05-03  1:21               ` David Lang
2004-05-04 17:27                 ` Timothy Miller
  -- strict thread matches above, loose matches on Subject: below --
2004-04-27 13:43 Albert Cahalan
2004-04-27 16:18 ` Jon
2004-04-27 16:58   ` Marc Boucher
2004-04-27 17:25     ` Adam Jaskiewicz
2004-04-27 17:33       ` Marc Boucher
2004-04-27 17:46         ` Chris Friesen
2004-04-27 17:53           ` Grzegorz Kulewski
2004-04-27 18:10             ` Chris Friesen
2004-04-27 20:37               ` Timothy Miller
2004-04-27 20:44                 ` Grzegorz Kulewski
2004-04-27 18:54             ` Valdis.Kletnieks
2004-04-27 19:03               ` Jorge Bernal (Koke)
2004-04-27 19:16                 ` Grzegorz Kulewski
2004-04-27 19:41                   ` Jorge Bernal (Koke)
2004-04-27 20:18                     ` Valdis.Kletnieks
2004-04-28 11:23               ` Helge Hafting
2004-04-27 18:10           ` Marc Boucher
2004-04-27 18:30             ` Chris Friesen
2004-04-27 20:40               ` Timothy Miller
2004-04-28  0:08               ` Carl-Daniel Hailfinger
2004-04-27 19:54         ` Tigran Aivazian
2004-04-28 11:28         ` Helge Hafting
2004-04-27 23:12     ` Rusty Russell
2004-04-28  0:02       ` Marc Boucher
2004-04-28  0:25         ` David Gibson
2004-04-28  1:14           ` Marc Boucher
2004-04-28  3:23             ` Horst von Brand
2004-04-28  6:04               ` Marc Boucher
2004-04-28 17:05                 ` Horst von Brand
2004-04-28 17:37             ` Timothy Miller
2004-04-28 19:31               ` Marc Boucher
2004-04-28 19:46                 ` Timothy Miller
2004-04-29  0:02                 ` Rik van Riel
2004-04-29  0:40                   ` Nick Piggin
2004-04-29  2:20                     ` Kenneth Aafløy
2004-04-29  2:31                   ` Marc Boucher
2004-04-29  2:36                     ` Ian Stirling
2004-04-29  2:38                       ` Rik van Riel
2004-04-29  2:47                         ` Ian Stirling
2004-04-29  2:47                       ` Kenneth Aafløy
2004-04-29 22:47                         ` Denis Vlasenko
2004-04-30 15:57                     ` Paulo Marques
2004-04-29 15:15                   ` Timothy Miller
2004-04-29 15:14                     ` Rik van Riel
2004-04-29 21:00                       ` Paul Wagland
2004-04-29 21:36                         ` Timothy Miller
2004-04-29 21:45                           ` viro
2004-04-29 21:47                           ` Jorge Bernal (Koke)
2004-04-29 22:24                             ` Marc Boucher
2004-04-29 22:32                               ` Tim Hockin
2004-04-29 22:49                                 ` Marc Boucher
2004-04-29 22:40                               ` viro
2004-04-29 23:55                               ` Sean Estabrooks
2004-04-30  2:15                                 ` Marc Boucher
2004-04-30  4:18                                   ` Bartlomiej Zolnierkiewicz
2004-04-30  4:32                                     ` Peter Williams
2004-04-30 14:49                                       ` Bartlomiej Zolnierkiewicz
2004-04-30 16:10                                       ` Timothy Miller
2004-04-30 20:01                                         ` Jesse Pollard
2004-04-30  4:43                                   ` Sean Estabrooks
2004-04-30  5:44                                     ` Marc Boucher
2004-04-30  6:13                                       ` Sean Estabrooks
2004-04-30  8:04                                       ` Jeff Garzik
2004-04-30  8:48                                         ` Jan-Benedict Glaw
2004-04-30 15:06                                         ` Tigran Aivazian
2004-04-30 15:43                                           ` Chris Friesen
2004-04-30 16:10                                             ` Marc Boucher
2004-04-30 16:30                                               ` Chris Friesen
2004-05-10  6:25                                                 ` Rogier Wolff
2004-05-10  7:08                                                   ` Måns Rullgård
2004-04-30 16:31                                               ` Gilles May
2004-04-30 16:50                                                 ` Marc Boucher
2004-04-30 17:44                                                   ` Michael Poole
2004-04-30 18:46                                                     ` Marc Boucher
2004-04-30 19:17                                                       ` Timothy Miller
2004-04-30 18:26                                                   ` Timothy Miller
2004-04-30 18:52                                                     ` Marc Boucher
2004-04-30 18:22                                               ` Timothy Miller
2004-04-30 18:01                                           ` Timothy Miller
2004-04-30  8:47                                       ` Jan-Benedict Glaw
2004-04-30  9:31                                   ` Geert Uytterhoeven
2004-04-30 15:57                                 ` Timothy Miller
2004-04-30 17:14                                   ` Marc Boucher
2004-04-30 17:46                                     ` Sean Estabrooks
2004-04-30 18:27                                       ` Timothy Miller
2004-04-30 11:49                           ` Helge Hafting
2004-04-30 16:20                             ` Timothy Miller
2004-04-30 21:03                               ` Gene Heskett
2004-04-30  9:16                     ` Geert Uytterhoeven
2004-04-28 23:43             ` Rik van Riel
2004-04-28  1:57         ` Rusty Russell
2004-04-28  3:28           ` Marc Boucher
2004-04-28 11:47             ` Helge Hafting
2004-04-28 16:15               ` Marc Boucher
2004-04-28 19:32                 ` Timothy Miller
2004-04-28 19:41                   ` Marc Boucher
2004-04-29 22:41                 ` Denis Vlasenko
2004-04-29 23:03                   ` Timothy Miller
2004-04-30 13:06                 ` Helge Hafting
2004-04-28 14:03             ` Tom Sightler
2004-04-28 16:40               ` Marc Boucher
2004-04-28 22:08                 ` Stephen Hemminger
2004-04-28 23:00                   ` Timothy Miller
2004-04-28 23:54                 ` Rik van Riel
2004-04-27 23:17     ` Carl-Daniel Hailfinger
2004-04-28  2:10     ` Horst von Brand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox