Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

From: Miroslav Benes
Date: Wed Feb 10 2016 - 05:34:16 EST


On Mon, 8 Feb 2016, Jessica Yu wrote:

> Remove the livepatch module notifier in favor of directly enabling and
> disabling patches to modules in the module loader. Hard-coding the
> function calls ensures that ftrace_module_enable() is run before
> klp_module_coming() during module load, and that klp_module_going() is
> run before ftrace_release_mod() during module unload. This way, ftrace
> and livepatch code is run in the correct order during the module
> load/unload sequence without dependence on the module notifier call chain.
>
> 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.
>
> Signed-off-by: Jessica Yu <jeyu@xxxxxxxxxx>
> Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
> Acked-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

Reviewed-by: Miroslav Benes <mbenes@xxxxxxx>

Miroslav