summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-08-18 15:57:38 +0200
committerIngo Molnar <mingo@kernel.org>2020-09-01 09:58:04 +0200
commit59cc8e0a906ea23190922e5e0252e5b5a60d70c2 (patch)
treeeff691f79d6d3589e0aba2fec51c78625042e271 /kernel
parent0340a6b7fb767f7f296b9bacc9a215920519a644 (diff)
module: Properly propagate MODULE_STATE_COMING failure
Now that notifiers got unbroken; use the proper interface to handle notifier errors and propagate them. There were already MODULE_STATE_COMING notifiers that failed; notably: - jump_label_module_notifier() - tracepoint_module_notify() - bpf_event_notify() By propagating this error, we fix those users. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Acked-by: Jessica Yu <jeyu@kernel.org> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20200818135804.444372853@infradead.org
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 1c5cff34d9f2..3c465cf31d08 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3792,9 +3792,13 @@ static int prepare_coming_module(struct module *mod)
if (err)
return err;
- blocking_notifier_call_chain(&module_notify_list,
- MODULE_STATE_COMING, mod);
- return 0;
+ err = blocking_notifier_call_chain_robust(&module_notify_list,
+ MODULE_STATE_COMING, MODULE_STATE_GOING, mod);
+ err = notifier_to_errno(err);
+ if (err)
+ klp_module_going(mod);
+
+ return err;
}
static int unknown_module_param_cb(char *param, char *val, const char *modname,