From: Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004@gmx.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Blacklist binary-only modules lying about their license
Date: Tue, 27 Apr 2004 04:09:36 +0200 [thread overview]
Message-ID: <408DC0E0.7090500@gmx.net> (raw)
[-- 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,
next reply other threads:[~2004-04-27 2:11 UTC|newest]
Thread overview: 197+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-27 2:09 Carl-Daniel Hailfinger [this message]
2004-04-27 3:13 ` [PATCH] Blacklist binary-only modules lying about their license 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
2004-04-27 19:03 Steve Lee
2004-04-27 19:37 ` Tigran Aivazian
2004-04-27 21:34 Robert M. Stockmann
2004-05-01 9:15 ` Tomas Szepe
2004-04-27 22:17 Nick Warne
[not found] <878ygh147m.fsf@sanosuke.troilus.org>
2004-04-27 22:59 ` Robert M. Stockmann
2004-04-27 23:05 ` Tim Hockin
2004-04-27 23:30 ` Robert M. Stockmann
2004-04-27 23:41 ` Tim Hockin
2004-04-27 23:59 ` Robert M. Stockmann
2004-05-01 9:19 ` Tomas Szepe
[not found] <20040428000952.GA19522@hockin.org>
2004-04-28 0:18 ` Robert M. Stockmann
[not found] <20040428003034.GA20811@hockin.org>
2004-04-28 0:56 ` Robert M. Stockmann
[not found] <20040428011348.GA22754@hockin.org>
2004-04-28 1:33 ` Robert M. Stockmann
2004-04-28 18:56 Keith D Burgess Jr
2004-04-28 23:45 ` Tim Connors
2004-04-30 22:48 ` David Woodhouse
2004-04-29 14:55 Rick Zeman
2004-04-30 17:47 Keith D Burgess Jr
2004-04-30 18:39 ` Timothy Miller
2004-04-30 19:37 ` Richard B. Johnson
2004-04-30 20:37 ` Horst von Brand
[not found] <009701c42edf$25e47390$ca41cb3f@amer.cisco.com>
2004-04-30 19:19 ` Linus Torvalds
2004-04-30 19:37 ` Hua Zhong
2004-04-30 20:11 ` Marc Boucher
2004-04-30 20:26 ` Linus Torvalds
2004-04-30 20:39 ` Marc Boucher
2004-04-30 20:44 ` Linus Torvalds
2004-04-30 20:53 ` Marc Boucher
2004-04-30 21:05 ` Linus Torvalds
2004-04-30 21:10 ` Timothy Miller
2004-04-30 20:46 ` Sean Estabrooks
2004-04-30 20:34 ` Stefan Smietanowski
2004-05-01 0:40 ` Jorge Bernal
2004-05-01 5:07 ` Martin J. Bligh
2004-05-01 19:12 ` Marc Boucher
2004-05-01 19:27 ` Davide Libenzi
2004-05-01 19:32 ` Zwane Mwaikambo
2004-05-01 19:33 ` Sean Estabrooks
2004-05-01 22:14 ` Randy.Dunlap
2004-05-01 19:47 ` Nicolas Pitre
2004-05-01 20:47 ` Martin J. Bligh
2004-05-01 20:58 ` Marc Boucher
2004-05-03 0:04 ` Horst von Brand
[not found] ` <40929F5B.9090603@techsource.com>
2004-04-30 18:58 ` Hua Zhong
2004-04-30 20:14 ` Bartlomiej Zolnierkiewicz
2004-04-30 20:02 Keith D Burgess Jr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=408DC0E0.7090500@gmx.net \
--to=c-d.hailfinger.kernel.2004@gmx.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox