Skip to content

Commit 54be550

Browse files
AlisonSchofieldrostedt
authored andcommitted
tracepoint: Allow trace events in modules with TAINT_TEST
Commit 2852ca7 ("panic: Taint kernel if tests are run") introduced a new taint type, TAINT_TEST, to signal that an in-kernel test module has been loaded. TAINT_TEST taint type defaults into a 'bad_taint' list for kernel tracing and blocks the creation of trace events. This causes a problem for CXL testing where loading the cxl_test module makes all CXL modules out-of-tree, blocking any trace events. Trace events are in development for CXL at the moment and this issue was found in test with v6.0-rc1. Link: https://lkml.kernel.org/r/[email protected] Fixes: 2852ca7 ("panic: Taint kernel if tests are run") Reported-by: Ira Weiny <[email protected]> Suggested-by: Dan Williams <[email protected]> Tested-by: Ira Weiny <[email protected]> Reviewed-by: David Gow <[email protected]> Signed-off-by: Alison Schofield <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent f72c3a2 commit 54be550

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/tracepoint.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,8 @@ static void for_each_tracepoint_range(
571571
bool trace_module_has_bad_taint(struct module *mod)
572572
{
573573
return mod->taints & ~((1 << TAINT_OOT_MODULE) | (1 << TAINT_CRAP) |
574-
(1 << TAINT_UNSIGNED_MODULE));
574+
(1 << TAINT_UNSIGNED_MODULE) |
575+
(1 << TAINT_TEST));
575576
}
576577

577578
static BLOCKING_NOTIFIER_HEAD(tracepoint_notify_list);
@@ -647,7 +648,7 @@ static int tracepoint_module_coming(struct module *mod)
647648
/*
648649
* We skip modules that taint the kernel, especially those with different
649650
* module headers (for forced load), to make sure we don't cause a crash.
650-
* Staging, out-of-tree, and unsigned GPL modules are fine.
651+
* Staging, out-of-tree, unsigned GPL, and test modules are fine.
651652
*/
652653
if (trace_module_has_bad_taint(mod))
653654
return 0;

0 commit comments

Comments
 (0)