module: setup load info before module_sig_check()
authorJessica Yu <jeyu@kernel.org>
Fri, 22 Jun 2018 12:00:01 +0000 (14:00 +0200)
committerJessica Yu <jeyu@kernel.org>
Fri, 22 Jun 2018 12:00:01 +0000 (14:00 +0200)
commit5fdc7db6448a4f558f298b1c98d6d124fdf2ad95
tree0fa4e7eedfa836c88c0d3bde35fb1c03f457988d
parent81a0abd9f213704fbeeea1550ff202000e3c3cdf
module: setup load info before module_sig_check()

We want to be able to log the module name in early error messages, such as
when module signature verification fails.  Previously, the module name is
set in layout_and_allocate(), meaning that any error messages that happen
before (such as those in module_sig_check()) won't be logged with a module
name, which isn't terribly helpful.

In order to do this, reshuffle the order in load_module() and set up
load info earlier so that we can log the module name along with these
error messages. This requires splitting rewrite_section_headers() out of
setup_load_info().

While we're at it, clean up and split up the operations done in
layout_and_allocate(), setup_load_info(), and rewrite_section_headers()
more cleanly so these functions only perform what their names suggest.

Signed-off-by: Jessica Yu <jeyu@kernel.org>
kernel/module.c