Commit 1d1d8415 authored by Masami Hiramatsu (Google)'s avatar Masami Hiramatsu (Google) Committed by Pu Lehui
Browse files

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

stable inclusion
from stable-v6.6.69
commit d4d67fa7158daedfe0dbb264beb39238477f4023
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBJ86N

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d4d67fa7158d

--------------------------------

[ 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: 61424318 ("tracing/kprobes: Support module init function probing")
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarPu Lehui <pulehui@huawei.com>
parent 75c81bcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -702,7 +702,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 count_symbols(void *data, unsigned long unused)