]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
module: add module_elf_check_arch for module-specific checks
authorNicholas Piggin <npiggin@gmail.com>
Mon, 28 Nov 2022 04:15:36 +0000 (14:15 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 06:54:07 +0000 (17:54 +1100)
commitf9231a996e229c13d23f907352c2cea84bd1c30a
tree0fa18676b38f527206681d1f6ac431133c2b674d
parent2f228ee1ade5d8d1f26cf94863a36c5693023c58
module: add module_elf_check_arch for module-specific checks

The elf_check_arch() function is also used to test compatibility of
usermode binaries. Kernel modules may have more specific requirements,
for example powerpc would like to test for ABI version compatibility.

Add a weak module_elf_check_arch() that defaults to true, and call it
from elf_validity_check().

Signed-off-by: Jessica Yu <jeyu@kernel.org>
[np: added changelog, adjust name, rebase]
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221128041539.1742489-2-npiggin@gmail.com
include/linux/moduleloader.h
kernel/module/main.c