]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace/module: remove ftrace module notifier
authorJessica Yu <jeyu@redhat.com>
Tue, 16 Feb 2016 22:32:33 +0000 (17:32 -0500)
committerJiri Kosina <jkosina@suse.cz>
Wed, 17 Feb 2016 21:14:06 +0000 (22:14 +0100)
commitdf0c161e909fa56283349b998202e46211c3007d
treeb2850092d0b57e9c33bb8743ca5053ca6404552d
parent5eabfc9891cb12b658e4350e4e0128fe6661c936
ftrace/module: remove ftrace module notifier

Remove the ftrace module notifier in favor of directly calling
ftrace_module_enable() and ftrace_release_mod() in the module loader.
Hard-coding the function calls directly in the module loader removes
dependence on the module notifier call chain and provides better
visibility and control over what gets called when, which is important
to kernel utilities such as livepatch.

This fixes a notifier ordering issue in which the ftrace module notifier
(and hence ftrace_module_enable()) for coming modules was being called
after klp_module_notify(), which caused livepatch modules to initialize
incorrectly. This patch removes dependence on the module notifier call
chain in favor of hard coding the corresponding function calls in the
module loader. This ensures that ftrace and livepatch code get called in
the correct order on patch module load and unload.

Fixes: 200406cc2c29 ("ftrace: Fix the race between ftrace and insmod")
Signed-off-by: Jessica Yu <jeyu@redhat.com>
Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
include/linux/ftrace.h
kernel/module.c
kernel/trace/ftrace.c