]> git.baikalelectronics.ru Git - kernel.git/commit
kprobes: Fix to init kprobes in subsys_initcall
authorMasami Hiramatsu <mhiramat@kernel.org>
Mon, 3 Jun 2019 13:04:42 +0000 (22:04 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 16 Jul 2019 19:13:45 +0000 (15:13 -0400)
commitb4bda00f51ed9c7a3ebaec7f1d846408e156edc6
tree38b64d0ea1a67e1bde1328cf938e9d0070e62f5e
parentbbe3b1aeb787d8583aeec390f0f2a88c8e1984b7
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: b63b434d205a ("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>
kernel/kprobes.c