Skip to contentSkip to conversation

Linux Kernel Markers Support for Proprierary Modules

PATCH New Mathieu Desnoyers 1 participant 1 message Feb 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Linux Kernel Markers Support for Proprierary Modules

There seems to be good arguments for markers to support proprierary modules. So I am throwing this one-liner in and let's see how people react. It only makes sure that a module that has been "forced" to be loaded won't have its markers used. It is important to leave this check to make sure the kernel does not crash by expecting the markers part of the struct module by mistake in the case there is an incorrect checksum.

Discussion so far :
http://lkml.org/lkml/2008/1/22/226

Jon Masters <[email protected]> writes:
I notice in module.c:

#ifdef CONFIG_MARKERS
      if (!mod->taints)
              marker_update_probe_range(mod->markers,
                      mod->markers + mod->num_markers, NULL, NULL);

#endif

Is this an attempt to not set a marker for proprietary modules? [...]

* Frank Ch. Eigler ([email protected]) wrote:
I can't seem to find any discussion about this aspect. If this is the intent, it seems misguided to me. There may instead be a relationship to TAINT_FORCED_{RMMOD,MODULE}. Mathieu?

- FChE

On Tue, 2008-01-22 at 22:10 -0500, Mathieu Desnoyers wrote:
On my part, its mostly a matter of not crashing the kernel when someone tries to force modprobe of a proprietary module (where the checksums doesn't match) on a kernel that supports the markers. Not doing so causes the markers to try to find the marker-specific information in struct module which doesn't exist and OOPSes.

Christoph's point of view is rather more drastic than mine : it's not interesting for the kernel community to help proprietary modules writers, so it's a good idea not to give them marker support. (I CC'ed him so he can clarify his position).

* Frank Ch. Eigler ([email protected]) wrote:
[...]
Another way of looking at this though is that by allowing/encouraging proprietary module writers to include markers, we and their users get new diagnostic capabilities. It constitutes a little bit of opening up, which IMO we should reward rather than punish.

* Vladis Ketnieks ([email protected]) wrote:

Quoted 6 lines · Mathieu Desnoyers

This specific one is a kernel policy matter, and I personally don't have a strong opinion about it. I agree that you raise a good counter argument : it can be useful to proprietary modules users to be able to extract tracing information from those modules to argue with their vendors that their driver/hardware is broken (a tracer is _very_ useful in that kind of situation).

Amen, brother. Been there, done that, got the tshirt (not on Linux, but other operating systems).

Quoted 3 lines

However, it is also useful to proprieraty
module writers who can benefit from the merged kernel/modules traces. Do we want to give them this ability ?

The proprietary module writer has the *source* for the kernel and their module. There's no way you can prevent the proprietary module writers from using this feature as long as you allow other module writers to use it.

Quoted 2 lines

It would surely help writing
better proprieraty kernel modules.

The biggest complaint against proprietary modules is that they make it impossible for *us* to debug. And you want to argue *against* a feature that would allow them to develop better code that causes less crashes, and therefor less people *asking* for us to debug it?

Remember - when a user tries a Linux box with a proprietary module, and the experience sucks because the module sucks, they will walk away thinking "Linux sucks", not "That module sucks".

It applies on top of 2.6.24-git12.

CC "Frank Ch. Eigler" <[email protected]>
CC Jon Masters <[email protected]>
CC Rusty Russell <[email protected]>
CC Christoph Hellwig <[email protected]>
CC Linus Torvalds <[email protected]>
CC Andrew Morton <[email protected]>
---
 kernel/module.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/module.c +1 -1
Index: linux-2.6-lttng/kernel/module.c
===================================================================
@@ -2033,7 +2033,7 @@ static struct module *load_module(void _
 	add_kallsyms(mod, sechdrs, symindex, strindex, secstrings);
 
 #ifdef CONFIG_MARKERS
-	if (!mod->taints)
+	if (!(mod->taints & TAINT_FORCED_MODULE))
 		marker_update_probe_range(mod->markers,
 			mod->markers + mod->num_markers, NULL, NULL);
 #endif
Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68