Re: ndiswrapper and GPL-only symbols redux

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jon Masters <jonathan@...>
Cc: Andi Kleen <andi@...>, Alan Cox <alan@...>, <linux-kernel@...>, Rusty Russell <rusty@...>, Giridhar Pemmasani <pgiri@...>
Date: Wednesday, January 30, 2008 - 1:26 am

On Wed, 2008-01-30 at 05:07 +0000, Jon Masters wrote:

I'd prefer a new taint.  It's less likely to break.  It provides more
information in the stack dumps.  It makes it clear the difference
ndiswrapper and driverloader.

Here's the patch:
---

Introduce a new taint flag for ndiswrapper

Although ndiswrapper loads proprietary code, it's under GPL itself.
Introduce a different taint flag for this case, so that ndiswrapper
retains access to GPL-only symbols.

Add comments to show the difference between driverloader and
ndiswrapper.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 include/linux/kernel.h |    1 +
 kernel/module.c        |    5 ++++-
 kernel/panic.c         |    2 ++
 3 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a7283c9..861a6ae 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -240,6 +240,7 @@ extern enum system_states {
 #define TAINT_BAD_PAGE			(1<<5)
 #define TAINT_USER			(1<<6)
 #define TAINT_DIE			(1<<7)
+#define TAINT_BLOB_WRAPPER		(1<<8)
 
 extern void dump_stack(void) __cold;
 
diff --git a/kernel/module.c b/kernel/module.c
index f6a4e72..a64380c 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1925,8 +1925,11 @@ static struct module *load_module(void __user *umod,
 	/* Set up license info based on the info section */
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+	/* GPL, but may load proprietary code */
 	if (strcmp(mod->name, "ndiswrapper") == 0)
-		add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
+		add_taint_module(mod, TAINT_BLOB_WRAPPER);
+
+	/* Wrongly claims to be under GPL */
 	if (strcmp(mod->name, "driverloader") == 0)
 		add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
 
diff --git a/kernel/panic.c b/kernel/panic.c
index da4d6ba..b040812 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -152,6 +152,7 @@ EXPORT_SYMBOL(panic);
  *  'M' - System experienced a machine check exception.
  *  'B' - System has hit bad_page.
  *  'U' - Userspace-defined naughtiness.
+ *  'W' - Wrapper for untrusted binary blobs has been loaded.
  *
  *	The string is overwritten by the next call to print_taint().
  */
@@ -162,6 +163,7 @@ const char *print_tainted(void)
 	if (tainted) {
 		snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c",
 			tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G',
+			tainted & TAINT_BLOB_WRAPPER ? 'W' : ' ',
 			tainted & TAINT_FORCED_MODULE ? 'F' : ' ',
 			tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
 			tainted & TAINT_FORCED_RMMOD ? 'R' : ' ',

-- 
Regards,
Pavel Roskin
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 5:22 pm)
Re: ndiswrapper and GPL-only symbols redux, Jon Masters, (Tue Jan 29, 8:20 pm)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 9:48 pm)
Re: ndiswrapper and GPL-only symbols redux, Jon Masters, (Wed Jan 30, 1:04 am)
RE: ndiswrapper and GPL-only symbols redux, David Schwartz, (Wed Jan 30, 4:50 pm)
Re: ndiswrapper and GPL-only symbols redux, Zan Lynx, (Wed Jan 30, 1:38 am)
Re: ndiswrapper and GPL-only symbols redux, Geert Uytterhoeven, (Wed Jan 30, 3:40 am)
Re: ndiswrapper and GPL-only symbols redux, Jan Engelhardt, (Tue Jan 29, 10:08 pm)
Re: ndiswrapper and GPL-only symbols redux, Jan Engelhardt, (Tue Jan 29, 8:35 pm)
Re: ndiswrapper and GPL-only symbols redux, Jon Masters, (Tue Jan 29, 8:48 pm)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 9:33 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Tue Jan 29, 6:57 pm)
Re: ndiswrapper and GPL-only symbols redux, Giridhar Pemmasani, (Tue Jan 29, 8:48 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Wed Jan 30, 1:54 pm)
Re: ndiswrapper and GPL-only symbols redux, David Newall, (Wed Jan 30, 11:25 pm)
Re: ndiswrapper and GPL-only symbols redux, Chris Friesen, (Thu Jan 31, 11:20 am)
Re: ndiswrapper and GPL-only symbols redux, Chris Friesen, (Wed Jan 30, 2:26 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Wed Jan 30, 2:54 pm)
Re: ndiswrapper and GPL-only symbols redux, Lee Revell, (Wed Jan 30, 3:36 pm)
Re: ndiswrapper and GPL-only symbols redux, Alan Cox, (Mon Feb 4, 8:42 am)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Mon Feb 4, 9:56 am)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Wed Jan 30, 4:28 pm)
Re: ndiswrapper and GPL-only symbols redux, Michael Gerdau, (Wed Jan 30, 9:00 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Tue Feb 5, 9:00 am)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 7:44 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Tue Jan 29, 8:25 pm)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 10:02 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Wed Jan 30, 1:54 pm)
Re: ndiswrapper and GPL-only symbols redux, Lennart Sorensen, (Wed Jan 30, 2:15 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Wed Jan 30, 2:45 pm)
Re: ndiswrapper and GPL-only symbols redux, Lennart Sorensen, (Wed Jan 30, 3:43 pm)
Re: ndiswrapper and GPL-only symbols redux, Adrian Bunk, (Wed Jan 30, 5:09 pm)
Re: ndiswrapper and GPL-only symbols redux, Rusty Russell, (Wed Jan 30, 7:24 am)
Re: ndiswrapper and GPL-only symbols redux, Alan Cox, (Tue Jan 29, 7:04 pm)
Re: ndiswrapper and GPL-only symbols redux, Jan Engelhardt, (Tue Jan 29, 7:06 pm)
Re: ndiswrapper and GPL-only symbols redux, Alan Cox, (Tue Jan 29, 6:45 pm)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 7:56 pm)
Re: ndiswrapper and GPL-only symbols redux, Andi Kleen, (Tue Jan 29, 11:24 pm)
Re: ndiswrapper and GPL-only symbols redux, Jon Masters, (Wed Jan 30, 1:07 am)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Wed Jan 30, 1:26 am)
Re: ndiswrapper and GPL-only symbols redux, Andi Kleen, (Wed Jan 30, 2:03 am)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Wed Jan 30, 2:12 am)
Re: ndiswrapper and GPL-only symbols redux, Pavel Roskin, (Tue Jan 29, 7:21 pm)
Re: ndiswrapper and GPL-only symbols redux, Jon Masters, (Tue Jan 29, 8:25 pm)
Re: ndiswrapper and GPL-only symbols redux, Giridhar Pemmasani, (Tue Jan 29, 6:35 pm)