Skip to contentSkip to conversation

tracing/kprobe: Make trace_kprobe's module callback called after jump_label update

PATCH New Masami Hiramatsu (Google) 1 participant 1 message Dec 11, 2024 Tracing

lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

PATCH 1/1 tracing/kprobe: Make trace_kprobe's module callback called after jump_label update

From: Masami Hiramatsu (Google) <[email protected]>

Make sure the trace_kprobe's module notifer callback function is called after jump_label's callback is called. Since the trace_kprobe's callback eventually checks jump_label address during registering new kprobe on the loading module, jump_label must be updated before this registration happens.

Fixes 614243181050 ("tracing/kprobes: Support module init function probing")
---
 kernel/trace/trace_kprobe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_kprobe.c +1 -1
index bae26eb14449..52ddb694ddee 100644
@@ -720,7 +720,7 @@ static int trace_kprobe_module_callback(struct notifier_block *nb,
 
 static struct notifier_block trace_kprobe_module_nb = {
 	.notifier_call = trace_kprobe_module_callback,
-	.priority = 1	/* Invoked after kprobe module callback */
+	.priority = 2	/* Invoked after kprobe and jump_label module callback */
 };
 static int trace_kprobe_register_module_notifier(void)
 {