Skip to contentSkip to conversation

Add tainting for proprietary helper modules.

PATCH Dave Jones 11 participants 15 messages Dec 3, 2005 – Jan 6, 2006

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +5 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);
#1 lore raw
Quoted 12 lines · Dave Jones

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 10 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

ndiswrapper adds taint already, in load_ndis_driver().

Signature · 1 line
Zan Lynx <[email protected]>
author
#2 lore raw
Quoted 15 lines · Zan Lynx
Quoted 14 lines · Dave Jones

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
Quoted 10 lines

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 8 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

ndiswrapper adds taint already, in load_ndis_driver().

That's good to hear. Although I've definitly seen some reports which have come through untainted. My guesses are that the users were using an older ndiswrapper that didn't do this, or they were using a < 2.6.10 kernel at the time
(for which ndiswrapper doesn't do this).

Dave

#3 lore raw
In reply to Dave Jones
Quoted 12 lines · Dave Jones

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 10 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

So your are blacklisting certain drivers? If so, you probably should have an array containing their names plus a header-file into which the hundreds, perhaps thousands, of future module- names can be added.

... Not meant as a joke or an affront. User's should be able to know what hardware to NOT purchase because of the proprietary nature of their drivers. Putting a couple "exceptions" into code as above is not good coding practice. If you need to exclude stuff, there should be an exclusion procedure that treats all that stuff equally, no?

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.44 BogoMips). Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

author
#4 lore raw
Quoted 31 lines · linux-os (Dick Johnson)
Quoted 12 lines · Dave Jones

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 10 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

So your are blacklisting certain drivers? If so, you probably should have an array containing their names plus a header-file into which the hundreds, perhaps thousands, of future module- names can be added.

Quoted 6 lines

... Not meant as a joke or an affront. User's should be able to know what hardware to NOT purchase because of the proprietary nature of their drivers. Putting a couple "exceptions" into code as above is not good coding practice. If you need to exclude stuff, there should be an exclusion procedure that treats all that stuff equally, no?

There's a point where the effort of creating an array, and loops to parse it isn't worth it. For two entries, this seemed a lot simpler.

Though if there more additions, I'd agree.

Dave

#5 lore raw

IMHO ndiswrapper can't claim legitimately to be GPL, so just patch that.

Signature · 2 lines
Stephen Hemminger <[email protected]>
OSDL http://developer.osdl.org/~shemminger
#6 lore raw
Quoted 1 line · Stephen Hemminger

IMHO ndiswrapper can't claim legitimately to be GPL

Sure it is.

The applications it loads and runs may not be GPL, same as for Linux in general, but ndiswrapper is just fine.

There's no GPL non-conformance unless somebody is distributing code that extends GPL functionality without GPLing that code.

And NDIS does not violate that. Sure, it runs binary-only drivers developed for another O/S, but it is NOT distributing those.

Cheers

#7 lore raw
In reply to Stephen Hemminger
Quoted 2 lines · Stephen Hemminger

IMHO ndiswrapper can't claim legitimately to be GPL, so just patch that.

Actually it isnt so simple. Load ndiswrapper. Now load a GPL windows driver binary. I don't know if ndiswrapper itself could dig licenses out of windows modules but if so it could even conditionally taint.

Alan

#8 lore raw
Quoted 11 lines · Alan Cox
Quoted 2 lines · Stephen Hemminger

IMHO ndiswrapper can't claim legitimately to be GPL, so just patch that.

Actually it isnt so simple. Load ndiswrapper. Now load a GPL windows driver binary. I don't know if ndiswrapper itself could dig licenses out of windows modules but if so it could even conditionally taint.

Alan

On the other hand, if the windows driver were GPL then there wouldn't be any barrier to writing a native driver.

--
Brian Gerst

#9 lore raw
Quoted 7 lines · Brian Gerst
Quoted 6 lines · Alan Cox
Quoted 2 lines · Stephen Hemminger

IMHO ndiswrapper can't claim legitimately to be GPL, so just patch that.

Quoted 8 lines
Quoted 5 lines

Actually it isnt so simple. Load ndiswrapper. Now load a GPL windows driver binary. I don't know if ndiswrapper itself could dig licenses out of windows modules but if so it could even conditionally taint.

Alan

On the other hand, if the windows driver were GPL then there wouldn't be any barrier to writing a native driver.

Sure, but the point was to demonstrate in a clear and logical fashion that ndiswrapper could be GPL.

#10 lore raw
Quoted 12 lines · Alan Cox
Quoted 11 lines · Brian Gerst
Quoted 10 lines · Alan Cox
Quoted 2 lines · Stephen Hemminger

IMHO ndiswrapper can't claim legitimately to be GPL, so just patch that.

Actually it isnt so simple. Load ndiswrapper. Now load a GPL windows driver binary. I don't know if ndiswrapper itself could dig licenses out of windows modules but if so it could even conditionally taint.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Alan

On the other hand, if the windows driver were GPL then there wouldn't be any barrier to writing a native driver.

Sure, but the point was to demonstrate in a clear and logical fashion that ndiswrapper could be GPL.
-

so it would be OK to run a windows NDIS driver on Linux, by using ndiswrapper, as long as the windows NDIS driver is GPL?

Never mind its possible stack needs or who knows what else.

Signature · 1 line
~Randy
#11 lore raw
In reply to Dave Jones
Quoted 39 lines · Dave Jones
Quoted 31 lines · linux-os (Dick Johnson)
Quoted 12 lines · Dave Jones

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 10 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

So your are blacklisting certain drivers? If so, you probably should have an array containing their names plus a header-file into which the hundreds, perhaps thousands, of future module- names can be added.

Quoted 6 lines

... Not meant as a joke or an affront. User's should be able to know what hardware to NOT purchase because of the proprietary nature of their drivers. Putting a couple "exceptions" into code as above is not good coding practice. If you need to exclude stuff, there should be an exclusion procedure that treats all that stuff equally, no?

Quoted 7 lines

There's a point where the effort of creating an array, and loops to parse it isn't worth it. For two entries, this seemed a lot simpler.

Though if there more additions, I'd agree.

Dave

Hello,

You've hard-coded some module names, that itself `taints' the kernel source IMO. Blacklisting in kernel is both ugly and unacceptable.

I agree that it would be convenient for you to only check if there's `Not tainted' in oops messages. But I still suggest you to not hard-code them in the kernel source. Instead you could use some script to grep the problematic module
names in the `Modules linked in' field.

For the long run, we could:

1) Add some other mechanism, like MODULE_LICENSE_STRICT("GPL.strict").

GPL.strict: A GPL.strict module is not only itself licensed under GPL, but it shall not load/link any binary code (specially non-gpl binaries) nor any non-GPL.strict code. This definition goes recursively.

Then we let a module without GPL.strict taints the kernel. This time we treat everyone equally.

2) Fix the gpl in gpl3; follow the above.

Signature · 1 line
Coywolf Qi Hunt
#12 lore raw
Quoted 2 lines · Coywolf Qi Hunt

You've hard-coded some module names, that itself `taints' the kernel source IMO. Blacklisting in kernel is both ugly and unacceptable.

How about that: continue to blacklist ndiswrapper until it has capability to taint itself the kernel when loading a proprietary driver.

Xav

#13 lore raw
In reply to Coywolf Qi Hunt
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 8 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

(That's like putting the PCI name device database back in.)

Quoted 7 lines

You've hard-coded some module names, that itself `taints' the kernel source IMO. Blacklisting in kernel is both ugly and unacceptable.

I agree that it would be convenient for you to only check if there's `Not tainted' in oops messages. But I still suggest you to not hard-code them in the kernel source. Instead you could use some script to grep the problematic module
names in the `Modules linked in' field.

Quoted 8 lines

For the long run, we could:

1) Add some other mechanism, like MODULE_LICENSE_STRICT("GPL.strict").

GPL.strict: A GPL.strict module is not only itself licensed under GPL, but it shall not load/link any binary code (specially non-gpl binaries) nor any non-GPL.strict code. This definition goes recursively.

How are you going to verify that, how do you want to distinguish whether a certain byte range in memory (possibly beloaded with a windows driver) is prop or not?

Jan Engelhardt

#14 lore raw
Quoted 38 lines · Jan Engelhardt
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

Kernels that have had Windows drivers loaded into them are undebuggable. I've wasted a number of hours chasing bugs filed in Fedora bugzilla only to find out much later that the user had used such 'helpers', and their problems were unreproducable without them loaded.

kernel/module.c renamed from kernel/module.c~ +0 -0
@@ -1723,6 +1723,11 @@ static struct module *load_module(void _
 	/* Set up license info based on the info section */
 	set_license(mod, get_modinfo(sechdrs, infoindex, "license"));
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

kernel/module.c static struct module *load_module(void _ · line 1733

Quoted 8 lines
kernel/module.c renamed from kernel/module.c~ +5 -0
+	if (strcmp(mod->name, "ndiswrapper") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+	if (strcmp(mod->name, "driverloader") == 0)
+		add_taint(TAINT_PROPRIETARY_MODULE);
+
 #ifdef CONFIG_MODULE_UNLOAD
 	/* Set up MODINFO_ATTR fields */
 	setup_modinfo(mod, sechdrs, infoindex);

(That's like putting the PCI name device database back in.)

Quoted 11 lines

You've hard-coded some module names, that itself `taints' the kernel source IMO. Blacklisting in kernel is both ugly and unacceptable.

I agree that it would be convenient for you to only check if there's `Not tainted' in oops messages. But I still suggest you to not hard-code them in the kernel source. Instead you could use some script to grep the problematic module
names in the `Modules linked in' field.

For the long run, we could:

1) Add some other mechanism, like MODULE_LICENSE_STRICT("GPL.strict").

Quoted 8 lines
Quoted 4 lines

GPL.strict: A GPL.strict module is not only itself licensed under GPL, but it shall not load/link any binary code (specially non-gpl binaries) nor any non-GPL.strict code. This definition goes recursively.

How are you going to verify that, how do you want to distinguish whether a certain byte range in memory (possibly beloaded with a windows driver) is prop or not?

Simple, I don't verify that. But I know if a program is capable to link some binary to itself, this program is no longer gpl.strict. Whether it loads prop or not depends on the user. But at the time the author writes such programs, the risk is open.

These binary-linking programs, under a gpl disguise, may look innocent, but they are especially dangerous to the free world. We need gpl.strict to keep away from them.

Signature · 1 line
Coywolf Qi Hunt