[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87iog2arfk.fsf@rustcorp.com.au>
Date: Tue, 20 Jan 2015 17:07:19 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Andrey Tsyvarev <tsyvarev@...ras.ru>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] kernel/module.c: Free lock-classes if parse_args failed
Andrey Tsyvarev <tsyvarev@...ras.ru> writes:
> parse_args call module parameters' .set handlers, which may use locks defined in the module.
> So, these classes should be freed in case parse_args returns error(e.g. due to incorrect parameter passed).
Thanks, this seems right. Applied.
But this makes me ask: where is lockdep_free_key_range() called on the
module init code? It doesn't seem to be at all...
Confused,
Rusty.
> Signed-off-by: Andrey Tsyvarev <tsyvarev@...ras.ru>
> ---
> kernel/module.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 3965511..2b44de4 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -3311,6 +3311,9 @@ static int load_module(struct load_info *info, const char __user *uargs,
> module_bug_cleanup(mod);
> mutex_unlock(&module_mutex);
>
> + /* Free lock-classes: */
> + lockdep_free_key_range(mod->module_core, mod->core_size);
> +
> /* 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists