Skip to content

Commit 65fc965

Browse files
mhiramatrostedt
authored andcommitted
kprobes: Fix to init kprobes in subsys_initcall
Since arm64 kernel initializes breakpoint trap vector in arch_initcall(), initializing kprobe (and run smoke test) in postcore_initcall() causes a kernel panic. To fix this issue, move the kprobe initialization in subsys_initcall() (which is called right afer the arch_initcall). In-kernel kprobe users (ftrace and bpf) are using fs_initcall() which is called after subsys_initcall(), so this shouldn't cause more problem. Link: http://lkml.kernel.org/r/155956708268.12228.10363800793132214198.stgit@devnote2 Link: http://lkml.kernel.org/r/20190709153755.GB10123@lakrids.cambridge.arm.com Reported-by: Anders Roxell <anders.roxell@linaro.org> Fixes: b5f8b32 ("kprobes: Initialize kprobes at postcore_initcall") Tested-by: Anders Roxell <anders.roxell@linaro.org> Tested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent f0553dc commit 65fc965

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/kprobes.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ static int __init init_kprobes(void)
22892289
init_test_probes();
22902290
return err;
22912291
}
2292-
postcore_initcall(init_kprobes);
2292+
subsys_initcall(init_kprobes);
22932293

22942294
#ifdef CONFIG_DEBUG_FS
22952295
static void report_probe(struct seq_file *pi, struct kprobe *p,

0 commit comments

Comments
 (0)