Commit c10076c4304083af15a41f6bc5e657e781c1f9a6
Committed by
Steven Rostedt
1 parent
2e885057b7
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
tracepoints/module: Fix disabling tracepoints with taint CRAP or OOT
Tracepoints are disabled for tainted modules, which is usually because the module is either proprietary or was forced, and we don't want either of them using kernel tracepoints. But, a module can also be tainted by being in the staging directory or compiled out of tree. Either is fine for use with tracepoints, no need to punish them. I found this out when I noticed that my sample trace event module, when done out of tree, stopped working. Cc: stable@vger.kernel.org # 3.2 Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Dave Jones <davej@redhat.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff
kernel/tracepoint.c
... | ... | @@ -634,10 +634,11 @@ |
634 | 634 | int ret = 0; |
635 | 635 | |
636 | 636 | /* |
637 | - * We skip modules that tain the kernel, especially those with different | |
638 | - * module header (for forced load), to make sure we don't cause a crash. | |
637 | + * We skip modules that taint the kernel, especially those with different | |
638 | + * module headers (for forced load), to make sure we don't cause a crash. | |
639 | + * Staging and out-of-tree GPL modules are fine. | |
639 | 640 | */ |
640 | - if (mod->taints) | |
641 | + if (mod->taints & ~((1 << TAINT_OOT_MODULE) | (1 << TAINT_CRAP))) | |
641 | 642 | return 0; |
642 | 643 | mutex_lock(&tracepoints_mutex); |
643 | 644 | tp_mod = kmalloc(sizeof(struct tp_module), GFP_KERNEL); |