Re: [PATCH] module: change to print useful messages from elf_validity_check()

From: Luis Chamberlain
Date: Wed Oct 13 2021 - 09:07:44 EST


On Mon, Oct 04, 2021 at 02:06:25PM -0600, Shuah Khan wrote:
> elf_validity_check() checks ELF headers for errors and ELF Spec.
> compliance and if any of them fail it returns -ENOEXEC from all of
> these error paths. Almost all of them don't print any messages.
>
> When elf_validity_check() returns an error, load_module() prints an
> error message without error code. It is hard to determine why the
> module ELF structure is invalid, even if load_module() prints the
> error code which is -ENOEXEC in all of these cases.
>
> Change to print useful error messages from elf_validity_check() to
> clearly say what went wrong and why the ELF validity checks failed.
>
> Remove the load_module() error message which is no longer needed.
>
> Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>

Thanks! Queued for modules-next [0].

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=modules-next

Luis