module: Add module name to modinfo
authorKees Cook <keescook@chromium.org>
Fri, 21 Apr 2017 22:35:27 +0000 (15:35 -0700)
committerJessica Yu <jeyu@redhat.com>
Tue, 23 May 2017 21:08:31 +0000 (14:08 -0700)
commit3e2e857f9c3a19d55ee0ba7b428b8be5008960bf
treea6d4eccd60502ff4b2913dfb55f59f342fd26e28
parent490194269665d6d4915a4a5774f002885c5a2d8f
module: Add module name to modinfo

Accessing the mod structure (e.g. for mod->name) prior to having completed
check_modstruct_version() can result in writing garbage to the error logs
if the layout of the mod structure loaded from disk doesn't match the
running kernel's mod structure layout. This kind of mismatch will become
much more likely if a kernel is built with different randomization seed
for the struct layout randomization plugin.

Instead, add and use a new modinfo string for logging the module name.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jessica Yu <jeyu@redhat.com>
kernel/module.c
scripts/mod/modpost.c