[PATCH] module: Enable dynamic debugging regardless of taint

From: Ben Hutchings
Date: Tue Nov 01 2011 - 00:00:00 EST


Dynamic debugging is currently disabled for tainted modules, except
for TAINT_CRAP. This prevents use of dynamic debugging for
out-of-tree modules now that they are also tainted.

This condition was apparently intended to avoid a crash if a force-
loaded module has an incompatible definition of dynamic debug
structures. However, a administrator that forces us to load a module
is claiming that it *is* compatible even though it fails our version
checks. If they are mistaken, there are any number of ways the module
could crash the system.

Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
kernel/module.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index dab585e..ef8cb70 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2881,8 +2881,7 @@ static struct module *load_module(void __user *umod,
}

/* This has to be done once we're sure module name is unique. */
- if (!mod->taints || mod->taints == (1U<<TAINT_CRAP))
- dynamic_debug_setup(info.debug, info.num_debug);
+ dynamic_debug_setup(info.debug, info.num_debug);

/* Find duplicate symbols */
err = verify_export_symbols(mod);
@@ -2918,8 +2917,7 @@ static struct module *load_module(void __user *umod,
module_bug_cleanup(mod);

ddebug:
- if (!mod->taints || mod->taints == (1U<<TAINT_CRAP))
- dynamic_debug_remove(info.debug);
+ dynamic_debug_remove(info.debug);
unlock:
mutex_unlock(&module_mutex);
synchronize_sched();
--
1.7.7


--
Ben Hutchings
Computers are not intelligent. They only think they are.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/