* [PATCH] module: Call module notifier on failure after complete_formation()
@ 2015-05-08 15:17 Steven Rostedt
2015-05-08 15:22 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2015-05-08 15:17 UTC (permalink / raw)
To: Rusty Russell; +Cc: LKML, Andrew Morton, stable, Pontus Fuchs
The module notifier call chain for MODULE_STATE_COMING was moved up before
the parsing of args, into the complete_formation() call. But if the module failed
to load after that, the notifier call chain for MODULE_STATE_GOING was
never called and that prevented the users of those call chains from
cleaning up anything that was allocated.
Link: http://lkml.kernel.org/r/554C52B9.9060700@gmail.com
Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Fixes: 4982223e51e8 "module: set nx before marking module MODULE_STATE_COMING"
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/module.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/module.c b/kernel/module.c
index 42a1d2afb217..cfc9e843a924 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3370,6 +3370,9 @@ static int load_module(struct load_info *info, const char __user *uargs,
module_bug_cleanup(mod);
mutex_unlock(&module_mutex);
+ blocking_notifier_call_chain(&module_notify_list,
+ MODULE_STATE_GOING, mod);
+
/* we can't deallocate the module until we clear memory protection */
unset_module_init_ro_nx(mod);
unset_module_core_ro_nx(mod);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] module: Call module notifier on failure after complete_formation()
2015-05-08 15:17 [PATCH] module: Call module notifier on failure after complete_formation() Steven Rostedt
@ 2015-05-08 15:22 ` Steven Rostedt
2015-05-08 17:56 ` Rusty Russell
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2015-05-08 15:22 UTC (permalink / raw)
To: Rusty Russell; +Cc: LKML, Andrew Morton, stable, Pontus Fuchs
On Fri, 8 May 2015 11:17:36 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
>
> The module notifier call chain for MODULE_STATE_COMING was moved up before
> the parsing of args, into the complete_formation() call. But if the module failed
> to load after that, the notifier call chain for MODULE_STATE_GOING was
> never called and that prevented the users of those call chains from
> cleaning up anything that was allocated.
>
> Link: http://lkml.kernel.org/r/554C52B9.9060700@gmail.com
You can nuke the "Link". I didn't realize Pontus didn't Cc any mailing
lists, and I manually just added it. Usually my scripts will check if
lkml was Cc'd and only add the "Link" tag if it was. Just shows you
that my scripts are smarter than I am.
-- Steve
>
> Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
> Fixes: 4982223e51e8 "module: set nx before marking module MODULE_STATE_COMING"
> Cc: stable@vger.kernel.org # 3.16+
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> kernel/module.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 42a1d2afb217..cfc9e843a924 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3370,6 +3370,9 @@ static int load_module(struct load_info *info, const char __user *uargs,
> module_bug_cleanup(mod);
> mutex_unlock(&module_mutex);
>
> + blocking_notifier_call_chain(&module_notify_list,
> + MODULE_STATE_GOING, mod);
> +
> /* we can't deallocate the module until we clear memory protection */
> unset_module_init_ro_nx(mod);
> unset_module_core_ro_nx(mod);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] module: Call module notifier on failure after complete_formation()
2015-05-08 15:22 ` Steven Rostedt
@ 2015-05-08 17:56 ` Rusty Russell
0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2015-05-08 17:56 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, Andrew Morton, stable, Pontus Fuchs
Steven Rostedt <rostedt@goodmis.org> writes:
> On Fri, 8 May 2015 11:17:36 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
>>
>> The module notifier call chain for MODULE_STATE_COMING was moved up before
>> the parsing of args, into the complete_formation() call. But if the module failed
>> to load after that, the notifier call chain for MODULE_STATE_GOING was
>> never called and that prevented the users of those call chains from
>> cleaning up anything that was allocated.
>>
>> Link: http://lkml.kernel.org/r/554C52B9.9060700@gmail.com
>
> You can nuke the "Link". I didn't realize Pontus didn't Cc any mailing
> lists, and I manually just added it. Usually my scripts will check if
> lkml was Cc'd and only add the "Link" tag if it was. Just shows you
> that my scripts are smarter than I am.
Thanks for this.
Applied,
Rusty.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-09 0:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08 15:17 [PATCH] module: Call module notifier on failure after complete_formation() Steven Rostedt
2015-05-08 15:22 ` Steven Rostedt
2015-05-08 17:56 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox