]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
module: add stop-grap sanity check on module memcpy()
authorLuis Chamberlain <mcgrof@kernel.org>
Sun, 19 Mar 2023 21:35:39 +0000 (14:35 -0700)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 24 Mar 2023 18:33:08 +0000 (11:33 -0700)
commitc7ee8aebf6c0588c0aab76538aff395c3abf811c
treeda8378b7e0eb83dc9cba8e95c40b7cc3f63e82b8
parent46752820f9abc013b6bd8172562b642376723313
module: add stop-grap sanity check on module memcpy()

The integrity of the struct module we load is important, and although
our ELF validator already checks that the module section must match
struct module, add a stop-gap check before we memcpy() the final minted
module. This also makes those inspecting the code what the goal is.

While at it, clarify the goal behind updating the sh_addr address.
The current comment is pretty misleading.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
kernel/module/main.c