diff options
author | Wang ShaoBo <[email protected]> | 2021-01-28 20:44:27 +0800 |
---|---|---|
committer | Steven Rostedt (VMware) <[email protected]> | 2021-01-29 17:29:16 -0500 |
commit | 0188b87899ffc4a1d36a0badbe77d56c92fd91dc (patch) | |
tree | 34f29e84d41767848b3f637b209cec1308e98782 /tools/perf/util/scripting-engines/trace-event-perl.c | |
parent | 97c753e62e6c31a404183898d950d8c08d752dbd (diff) |
kretprobe: Avoid re-registration of the same kretprobe earlier
Our system encountered a re-init error when re-registering same kretprobe,
where the kretprobe_instance in rp->free_instances is illegally accessed
after re-init.
Implementation to avoid re-registration has been introduced for kprobe
before, but lags for register_kretprobe(). We must check if kprobe has
been re-registered before re-initializing kretprobe, otherwise it will
destroy the data struct of kretprobe registered, which can lead to memory
leak, system crash, also some unexpected behaviors.
We use check_kprobe_rereg() to check if kprobe has been re-registered
before running register_kretprobe()'s body, for giving a warning message
and terminate registration process.
Link: https://lkml.kernel.org/r/[email protected]
Cc: [email protected]
Fixes: 1f0ab40976460 ("kprobes: Prevent re-registration of the same kprobe")
[ The above commit should have been done for kretprobes too ]
Acked-by: Naveen N. Rao <[email protected]>
Acked-by: Ananth N Mavinakayanahalli <[email protected]>
Acked-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Wang ShaoBo <[email protected]>
Signed-off-by: Cheng Jian <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
0 files changed, 0 insertions, 0 deletions