[hcflinux] [c-d.hailfinger.kernel.2004@gmx.net: [PATCH] Blacklist binary-only modules lying about their license]

Brandon Niemczyk maccorin at cfl.rr.com
Tue Apr 27 14:13:33 EDT 2004

I just wanted all of you to know what your linuxant is up too.

----- Forwarded message from Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004 at gmx.net> -----

Date: Tue, 27 Apr 2004 04:09:36 +0200
From: Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004 at gmx.net>
Subject: [PATCH] Blacklist binary-only modules lying about their license
To: Rusty Russell <rusty at rustcorp.com.au>
Cc: Linus Torvalds <torvalds at osdl.org>, Andrew Morton <akpm at osdl.org>,
        Linux Kernel Mailing List <linux-kernel at vger.kernel.org>
X-Accept-Language: de, en
Precedence: bulk
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821
X-Authenticated: #21910825
X-Enigmail-Supports: pgp-inline, pgp-mime
X-Virus-Scanned: Symantec AntiVirus Scan Engine
X-Mailing-List: linux-kernel at vger.kernel.org
Original-recipient: rfc822;brandonn at cfl.rr.com
X-Text-Classification: code


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.


--- 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 @@
 	/* 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,

----- End forwarded message -----

Brandon Niemczyk			Public PGP Key ID: CAB3D8D6 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.linuxant.com/pipermail/hcflinux/attachments/20040427/f6a06f68/attachment.bin

More information about the hcflinux mailing list