]> git.baikalelectronics.ru Git - kernel.git/commit
rethook: Add a generic return hook
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 15 Mar 2022 14:00:50 +0000 (23:00 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 18 Mar 2022 03:16:29 +0000 (20:16 -0700)
commit2da3ae3b065eab3d4c3d84045f80985b28643caa
tree409360f3d1dd0bafbbbf390c201dced76a64e063
parentd3379b5caf726e663fd7ce7cd4a45e455f8b99e7
rethook: Add a generic return hook

Add a return hook framework which hooks the function return. Most of the
logic came from the kretprobe, but this is independent from kretprobe.

Note that this is expected to be used with other function entry hooking
feature, like ftrace, fprobe, adn kprobes. Eventually this will replace
the kretprobe (e.g. kprobe + rethook = kretprobe), but at this moment,
this is just an additional hook.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/164735285066.1084943.9259661137330166643.stgit@devnote2
include/linux/rethook.h [new file with mode: 0644]
include/linux/sched.h
kernel/exit.c
kernel/fork.c
kernel/trace/Kconfig
kernel/trace/Makefile
kernel/trace/rethook.c [new file with mode: 0644]