]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
tracing/kprobe: Make trace_kprobe's module callback called after jump_label update
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 11 Dec 2024 00:10:55 +0000 (09:10 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Mon, 23 Dec 2024 15:08:13 +0000 (00:08 +0900)
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.

Link: https://lore.kernel.org/all/173387585556.995044.3157941002975446119.stgit@devnote2/
Fixes: 614243181050 ("tracing/kprobes: Support module init function probing")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/trace_kprobe.c

index 263fac44d3ca32ad0aee21c7e65ac744f1034ca7..935a886af40c908b28f7ab70ac3c23ad2fb53866 100644 (file)
@@ -725,7 +725,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)
 {