]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Free the trampoline when ftrace_startup() fails
authorMiroslav Benes <mbenes@suse.cz>
Mon, 31 Aug 2020 12:26:31 +0000 (14:26 +0200)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 18 Sep 2020 16:19:08 +0000 (12:19 -0400)
commitc99c7770e476f52822a43d21f36dc1b3a7d7da5b
tree697631edc4da139080915b5e313b0c335a4da1e2
parent0757e4223f056646988901b5e59c079f538168d5
ftrace: Free the trampoline when ftrace_startup() fails

Commit 26e652e899b2 ("ftrace: Add symbols for ftrace trampolines")
missed to remove ops from new ftrace_ops_trampoline_list in
ftrace_startup() if ftrace_hash_ipmodify_enable() fails there. It may
lead to BUG if such ops come from a module which may be removed.

Moreover, the trampoline itself is not freed in this case.

Fix it by calling ftrace_trampoline_free() during the rollback.

Link: https://lkml.kernel.org/r/20200831122631.28057-1-mbenes@suse.cz
Fixes: 26e652e899b2 ("ftrace: Add symbols for ftrace trampolines")
Fixes: ce5a5b5ca18d ("ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict")
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/ftrace.c