module: avoid setting info->name early in case we can fall back to info->mod->name
authorJessica Yu <jeyu@kernel.org>
Fri, 17 Jan 2020 12:32:21 +0000 (13:32 +0100)
committerJessica Yu <jeyu@kernel.org>
Mon, 20 Jan 2020 15:59:39 +0000 (16:59 +0100)
commit708e0ada1916be765b7faa58854062f2bc620bbf
tree1d48125bdee9fdac04df6f33209acf21c9d6a8ed
parente9f35f634e099894f4d6c3b039cd3de5281ee637
module: avoid setting info->name early in case we can fall back to info->mod->name

In setup_load_info(), info->name (which contains the name of the module,
mostly used for early logging purposes before the module gets set up)
gets unconditionally assigned if .modinfo is missing despite the fact
that there is an if (!info->name) check near the end of the function.
Avoid assigning a placeholder string to info->name if .modinfo doesn't
exist, so that we can fall back to info->mod->name later on.

Fixes: 5fdc7db6448a ("module: setup load info before module_sig_check()")
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
kernel/module.c