From: Masami Hiramatsu (Google) Date: Wed, 11 Dec 2024 00:10:55 +0000 (+0900) Subject: tracing/kprobe: Make trace_kprobe's module callback called after jump_label update X-Git-Tag: v5.15.176~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=325c0e27668d49ccc0c239fd1dc73cdf9e11f428;p=thirdparty%2Fkernel%2Fstable.git tracing/kprobe: Make trace_kprobe's module callback called after jump_label update [ Upstream commit d685d55dfc86b1a4bdcec77c3c1f8a83f181264e ] 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) Signed-off-by: Sasha Levin --- diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index baaaf9bc05f2b..3a1c54c9918b4 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -705,7 +705,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 */ }; struct count_symbols_struct {