Skip to contentSkip to conversation

incorrect taint of ndiswrapper

DISCUSSION Giridhar Pemmasani 10 participants 20 messages Oct 23, 2006 – Oct 24, 2006

lore
Share & tools
lore
#0 lore raw

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Note that when a driver is loaded, ndiswrapper does taint the kernel (to be more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

Thanks,
Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#1 lore raw

Hello,

Have got the same problem. I just add the following:

1) dmesg claims __create_workqueue and __destroy_workqueue are undefined (kernel syms)
2) I've checked out System.map and they're of course present
3) no problem under 2.6.18.1
4) from ndiswrapper-1.15 to ndiswrapper-1.26

By the way, i would like so much if someone explain me why, since 2.6.18, on my Acer Laptop i had to add irqpoll to correctly boot (had already to use acpi=noirq) and still have strange errors on DVD detection at boot which strangely has not any consequence later. The problem is there since 2.6.18.

Thanks,

Gianluca

Quoted 21 lines · Giridhar Pemmasani

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Note that when a driver is loaded, ndiswrapper does taint the kernel (to be more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

Thanks,
Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
In reply to Giridhar Pemmasani
Quoted 3 lines · Giridhar Pemmasani

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Indeed. 'ndiswrapper' is intentionally tainted by kernel/module.c because it is used to load and run unknown binary / proprietary code in kernel-space. If this unknown binary / proprietary code were to contain a bug (which all code of that complexity tends to), it might write to memory it doesn't own, or coerce a device to do so on its behalf, making a kernel crash dump analysis into a wild goose chase (hence the reason for kernel taint).

Quoted 3 lines

Note that when a driver is loaded, ndiswrapper does taint the kernel (to be more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

Are you saying ndiswrapper voluntarily calls add_taint() whenever it loads an NDIS driver?

Are there even any examples of GPL-licensed NDIS drivers?

Quoted 3 lines

Thanks,
Giri

Thanks,
Chase

#3 lore raw
Quoted 14 lines · --- Chase Venters
Quoted 3 lines · Giridhar Pemmasani

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Indeed. 'ndiswrapper' is intentionally tainted by kernel/module.c because it
is used to load and run unknown binary / proprietary code in kernel-space. If
this unknown binary / proprietary code were to contain a bug (which all code
of that complexity tends to), it might write to memory it doesn't own, or coerce a device to do so on its behalf, making a kernel crash dump analysis

Quoted 1 line

into a wild goose chase (hence the reason for kernel taint).

Yes, I agree on the purpose of tainting the kernel.

Quoted 8 lines
Quoted 1 line

Note that when a driver is loaded, ndiswrapper does taint the kernel (to

be

Quoted 2 lines

more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

Are you saying ndiswrapper voluntarily calls add_taint() whenever it loads an
NDIS driver?

Exactly - the loader within ndiswrapper taints kernel versions 2.6.10 and newer (older kernels don't have a way of tainting the kernel). The code is in loader.c in ndiswrapper.

Quoted 1 line

Are there even any examples of GPL-licensed NDIS drivers?

I don't remember off hand, but sometime back there was discussion on related topic of weather ndiswrapper should be in debian-main or not, and someone pointed out a GPL ndis driver. (BTW, after much discussion on debian devel list, the developers agreed that ndiswrapper belongs in debian-main.)

Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#4 lore raw

Hi again,

tainting apart, do you get to load ndiswrapper ? On what kernel exactly ? I cant on rc2-mm2

Thanks

Gianluca

Quoted 67 lines · Giridhar Pemmasani
Quoted 8 lines · --- Chase Venters
Quoted 5 lines · Giridhar Pemmasani

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Quoted 8 lines

Indeed. 'ndiswrapper' is intentionally tainted by kernel/module.c because
it is used to load and run unknown binary / proprietary code in kernel-space.
If this unknown binary / proprietary code were to contain a bug (which all
code of that complexity tends to), it might write to memory it doesn't own, or coerce a device to do so on its behalf, making a kernel crash dump analysis

into a wild goose chase (hence the reason for kernel taint).

Yes, I agree on the purpose of tainting the kernel.

Quoted 6 lines
Quoted 3 lines

Note that when a driver is loaded, ndiswrapper does taint the kernel (to

be

Quoted 8 lines
Quoted 4 lines

more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

Are you saying ndiswrapper voluntarily calls add_taint() whenever it loads an NDIS driver?

Exactly - the loader within ndiswrapper taints kernel versions 2.6.10 and newer (older kernels don't have a way of tainting the kernel). The code is in loader.c in ndiswrapper.

Quoted 3 lines

Are there even any examples of GPL-licensed NDIS drivers?

I don't remember off hand, but sometime back there was discussion on related topic of weather ndiswrapper should be in debian-main or not, and someone pointed out a GPL ndis driver. (BTW, after much discussion on debian devel list, the developers agreed that ndiswrapper belongs in debian-main.)

Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#5 lore raw
In reply to Giridhar Pemmasani
Quoted 3 lines · Giridhar Pemmasani

Exactly - the loader within ndiswrapper taints kernel versions 2.6.10 and newer (older kernels don't have a way of tainting the kernel). The code is in loader.c in ndiswrapper.

Next question - what version of ndiswrapper started voluntary tainting (or has it always?)

That is to say, are there versions of ndiswrapper floating around out there in the ether capable of building against 2.6.19-rc* that don't voluntarily add_taint()? (I'm guessing the answer is 'no', but the answer is possibly important to consider)

The attached patch (untested) should keep the kernel from self-tainting when ndiswrapper is inserted. The last question, then, is how everyone else feels about this. Objections to removing the mandatory ndiswrapper taint?

kernel/module.c +0 -2
index 67009bd..f948a2c 100644
@@ -1717,8 +1717,6 @@ #endif
 	/* 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_module(mod, TAINT_PROPRIETARY_MODULE);
 	if (strcmp(mod->name, "driverloader") == 0)
 		add_taint_module(mod, TAINT_PROPRIETARY_MODULE);
 
#6 lore raw
Quoted 9 lines · --- Chase Venters

Next question - what version of ndiswrapper started voluntary tainting (or has
it always?)

That is to say, are there versions of ndiswrapper floating around out there in
the ether capable of building against 2.6.19-rc* that don't voluntarily add_taint()? (I'm guessing the answer is 'no', but the answer is possibly important to consider)

Since version 1.0, ndiswrapper has been tainting kernel when a driver is loaded. Version 1.0 is quite old (circa Jan 2005) and won't build with any recent kernels.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#7 lore raw
In reply to Giridhar Pemmasani

Hi,

if that can help, the problem with the undefined syms in ndiswrapper is that the module was tainted, and couldnt get EXPORT_SYMBOL_GPL'd __create_workqueue...

I applied Chase patch...everything goes.

In my opinion i would avoid tainting ndiswrapper.

Gianluca

Quoted 67 lines · Giridhar Pemmasani
Quoted 8 lines · --- Chase Venters
Quoted 5 lines · Giridhar Pemmasani

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Quoted 8 lines

Indeed. 'ndiswrapper' is intentionally tainted by kernel/module.c because
it is used to load and run unknown binary / proprietary code in kernel-space.
If this unknown binary / proprietary code were to contain a bug (which all
code of that complexity tends to), it might write to memory it doesn't own, or coerce a device to do so on its behalf, making a kernel crash dump analysis

into a wild goose chase (hence the reason for kernel taint).

Yes, I agree on the purpose of tainting the kernel.

Quoted 6 lines
Quoted 3 lines

Note that when a driver is loaded, ndiswrapper does taint the kernel (to

be

Quoted 8 lines
Quoted 4 lines

more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

Are you saying ndiswrapper voluntarily calls add_taint() whenever it loads an NDIS driver?

Exactly - the loader within ndiswrapper taints kernel versions 2.6.10 and newer (older kernels don't have a way of tainting the kernel). The code is in loader.c in ndiswrapper.

Quoted 3 lines

Are there even any examples of GPL-licensed NDIS drivers?

I don't remember off hand, but sometime back there was discussion on related topic of weather ndiswrapper should be in debian-main or not, and someone pointed out a GPL ndis driver. (BTW, after much discussion on debian devel list, the developers agreed that ndiswrapper belongs in debian-main.)

Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#8 lore raw
In reply to Giridhar Pemmasani
Quoted 7 lines · Giridhar Pemmasani
Quoted 1 line · --- Chase Venters

Are there even any examples of GPL-licensed NDIS drivers?

I don't remember off hand, but sometime back there was discussion on related topic of weather ndiswrapper should be in debian-main or not, and someone pointed out a GPL ndis driver. (BTW, after much discussion on debian devel list, the developers agreed that ndiswrapper belongs in debian-main.)

AFAIK, the only given example of a free NDIS driver was CIPE-Win32, which is a port of CIPE from Linux to Windows. It's quite pointless to use ndiswrapper for that.

Michal

#9 lore raw
In reply to Giridhar Pemmasani
Quoted 7 lines · Giridhar Pemmasani

It seems that the kernel module loader taints ndiswrapper module as proprietary, but it is not - it is fully GPL: see
http://directory.fsf.org/sysadmin/hookup/ndiswrapper.html

Note that when a driver is loaded, ndiswrapper does taint the kernel (to be more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

There is no reason (apart from "it hasn't been done yet2 which is a very weak reason) to use ndiswrapper with a GPL-module - just port the GPL-module over.

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services
#10 lore raw
In reply to Giridhar Pemmasani

Ar Sul, 2006-10-22 am 22:41 -0700, ysgrifennodd Giridhar Pemmasani:

Quoted 3 lines

Note that when a driver is loaded, ndiswrapper does taint the kernel (to be more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

However by then it has already dynamically linked with explicit GPLONLY symbols so it cannot then load a binary windows driver but should unload itself or refuse to load anything but the GPL ndis drivers (of which afaik only one exists), and even then they expect an environment incompatible with the Linux kernel.

#11 lore raw
Quoted 5 lines · --- Alan Cox

However by then it has already dynamically linked with explicit GPLONLY symbols so it cannot then load a binary windows driver but should unload itself or refuse to load anything but the GPL ndis drivers (of which afaik only one exists), and even then they expect an environment incompatible with the Linux kernel.

So the idea of tainting is to _prevent_ any binary code being loaded into kernel, even if kernel is marked as having binary code loaded, which I thought was the purpose of tainting (so that people not interested in dealing with binary code know they don't have/want to)? If that is the goal, how do you know this scheme of adding names to module loader in kernel guarantees that (now or in future)?

Thanks,
Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#12 lore raw

Ar Llu, 2006-10-23 am 04:35 -0700, ysgrifennodd Giridhar Pemmasani:

Quoted 6 lines

So the idea of tainting is to _prevent_ any binary code being loaded into kernel, even if kernel is marked as having binary code loaded, which I thought was the purpose of tainting (so that people not interested in dealing with binary code know they don't have/want to)? If that is the goal, how do you know this scheme of adding names to module loader in kernel guarantees that (now or in future)?

There are two overlapping mechanisms here

Taint is used to identify situations where debug data may not be good, that may be proprietary or other dubiously legal code, it may be forcing SMP active on non SMP suitable systems, it may be overriding certain options in a potentially hazardous fashion. Taint exists primarily to help debugging data analysis.

EXPORT_SYMBOL_GPL() is used to assert that the symbol is absolutely definitely not a public symbol. EXPORT_SYMBOL exports symbols which might be but even then the GPL derivative work rules apply. When you mark a driver GPL it is permitted to use _GPL symbols, but if it does so it cannot then go and load other non GPL symbols and expect people not to question its validity.

#13 lore raw
Quoted 5 lines · --- Alan Cox

Taint is used to identify situations where debug data may not be good, that may be proprietary or other dubiously legal code, it may be forcing SMP active on non SMP suitable systems, it may be overriding certain options in a potentially hazardous fashion. Taint exists primarily to help debugging data analysis.

I have read the history of the patch that marked ndiswrapper as "proprietary module", which is not correct (and that was the point of my original post). All the posts realted to this referred to issues with loading binary code into kernel (and since ndiswrapper does taint the kernel when a driver is loaded, this again is misplaced).

Quoted 6 lines

EXPORT_SYMBOL_GPL() is used to assert that the symbol is absolutely definitely not a public symbol. EXPORT_SYMBOL exports symbols which might be but even then the GPL derivative work rules apply. When you mark a driver GPL it is permitted to use _GPL symbols, but if it does so it cannot then go and load other non GPL symbols and expect people not to question its validity.

I was not fully aware of this issue until now (I have read posts related to this issue now). Does this mean that any module that loads binary code can't be GPL, even those that load firmware files? How is non-GPL-due-to-transitivity going to be checked? Why does module loader mark only couple of modules as non-GPL, when there are other drivers that load some sort of binary code? It is understandable to mark a module as non-GPL if it is lying about its license, but as far as that is concerned, ndiswrapper (alone) is GPL.

Thanks,
Giri

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#14 lore raw
Quoted 8 lines · On Mon, 23 Oct 2006 19:43:47 -0700 (PDT) Giridhar Pemmasani wrote:
Quoted 5 lines · --- Alan Cox

Taint is used to identify situations where debug data may not be good, that may be proprietary or other dubiously legal code, it may be forcing SMP active on non SMP suitable systems, it may be overriding certain options in a potentially hazardous fashion. Taint exists primarily to help debugging data analysis.

Quoted 5 lines

I have read the history of the patch that marked ndiswrapper as "proprietary module", which is not correct (and that was the point of my original post). All the posts realted to this referred to issues with loading binary code into kernel (and since ndiswrapper does taint the kernel when a driver is loaded, this again is misplaced).

The kernel should not depend on a not-in-tree kernel module to taint the kernel. The kernel can and should do that itself.

(big) If ndiswrapper were ever added to the kernel tree, then that would be a reasonable place to do/add the tainting.

Quoted 7 lines
Quoted 6 lines

EXPORT_SYMBOL_GPL() is used to assert that the symbol is absolutely definitely not a public symbol. EXPORT_SYMBOL exports symbols which might be but even then the GPL derivative work rules apply. When you mark a driver GPL it is permitted to use _GPL symbols, but if it does so it cannot then go and load other non GPL symbols and expect people not to question its validity.

Quoted 8 lines

I was not fully aware of this issue until now (I have read posts related to this issue now). Does this mean that any module that loads binary code can't be GPL, even those that load firmware files? How is non-GPL-due-to-transitivity going to be checked? Why does module loader mark only couple of modules as non-GPL, when there are other drivers that load some sort of binary code? It is understandable to mark a module as non-GPL if it is lying about its license, but as far as that is concerned, ndiswrapper (alone) is GPL.

---
~Randy

#15 lore raw
Quoted 2 lines · Randy Dunlap

The kernel should not depend on a not-in-tree kernel module to taint the kernel. The kernel can and should do that itself.

Agreed. But should the kernel disallow the use of _GPL symbols for ndiswrapper? I would say no.

#16 lore raw

Ar Maw, 2006-10-24 am 15:12 +0300, ysgrifennodd Pekka Enberg:

Quoted 6 lines · Randy Dunlap
Quoted 2 lines

The kernel should not depend on a not-in-tree kernel module to taint the kernel. The kernel can and should do that itself.

Agreed. But should the kernel disallow the use of _GPL symbols for ndiswrapper? I would say no.

I'd agree providing the attempt to taint function allows an error return if it did so and it then refuses to load non-GPL windows drivers.

#17 lore raw
In reply to Giridhar Pemmasani

Ar Llu, 2006-10-23 am 19:43 -0700, ysgrifennodd Giridhar Pemmasani:

Quoted 3 lines

I was not fully aware of this issue until now (I have read posts related to this issue now). Does this mean that any module that loads binary code can't be GPL, even those that load firmware files? How is

Firmware is usually more clearly separated (the problem ultimately is that "derived work" is a legal not a technical distinction).

Quoted 5 lines

non-GPL-due-to-transitivity going to be checked? Why does module loader mark only couple of modules as non-GPL, when there are other drivers that load some sort of binary code? It is understandable to mark a module as non-GPL if it is lying about its license, but as far as that is concerned, ndiswrapper (alone) is GPL.

Yes. I don't think the current situation is neccessarily correct, but if it uses EXPORT_SYMBOL_GPL then the "now taint me" ought to fail and the driver ought to refuse to load a non GPL windows driver.

Alan

#18 lore raw
In reply to Alan Cox
Quoted 10 lines · Alan Cox

Ar Sul, 2006-10-22 am 22:41 -0700, ysgrifennodd Giridhar Pemmasani:

Quoted 3 lines

Note that when a driver is loaded, ndiswrapper does taint the kernel (to be more accurate, it should check if the driver being loaded is GPL or not, but that is not done).

However by then it has already dynamically linked with explicit GPLONLY symbols so it cannot then load a binary windows driver but should unload itself or refuse to load anything but the GPL ndis drivers (of which afaik only one exists), and even then they expect an environment incompatible with the Linux kernel.

The kernel itself links GPL code to non-GPL via the Posix API (the syscall layer). The kernel also links GPL code to non-GPL via the PCI layer (all that proprietary firmware on the other side). The ndiswrapper links GPL code to non-GPL via the NDIS API.

No difference, really. Implementing a well-defined interface abstraction layer doesn't make either side of it derived from the other. (Exactly how well-defined, how abstract, and how derived are all arguments for the lawyers.)

Signature · 1 line
Zan Lynx <[email protected]>
#19 lore raw
Quoted 7 lines

The kernel itself links GPL code to non-GPL via the Posix API (the syscall layer). The kernel also links GPL code to non-GPL via the PCI layer (all that proprietary firmware on the other side). The ndiswrapper links GPL code to non-GPL via the NDIS API.

No difference, really.

Behind the syscall layer is userspace (the well known ring 3), which, all bugs and problems aside, and exceptions like ioperm ruled out, cannot crash the kernel.

I am not too aware about firmware and how it affects the running kernel, but usually it is a binary blob that gets loaded into the PCI device. May or may not crash the kernel - as said, I am not too aware of how it can tamper with the kernel.

NDIS code however is, unlike the above, run unconditionally in superprivileged level (ring 0), which quite distinct from userspace or firmwarespace[note warning above].

Lastly, there is the new IIO code, which sounds like it is a well-defined (you name it) interface, to userspace however.

If Windows drivers could run in userspace, there would not be a problem, would there be?

Quoted 7 lines

Implementing a well-defined interface
abstraction layer doesn't make either side of it derived from the other. (Exactly how well-defined, how abstract, and how derived are all arguments for the lawyers.)

Signature · 1 line
Zan Lynx <[email protected]>
	-`J'