aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/moduleloader.h
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2022-11-28 14:15:36 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2022-12-02 17:54:07 +1100
commitf9231a996e229c13d23f907352c2cea84bd1c30a (patch)
tree0fa18676b38f527206681d1f6ac431133c2b674d /include/linux/moduleloader.h
parentpowerpc/code-patching: Consolidate and cache per-cpu patching context (diff)
downloadwireguard-linux-f9231a996e229c13d23f907352c2cea84bd1c30a.tar.xz
wireguard-linux-f9231a996e229c13d23f907352c2cea84bd1c30a.zip
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
Diffstat (limited to 'include/linux/moduleloader.h')
-rw-r--r--include/linux/moduleloader.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index 9e09d11ffe5b..7b4587a19189 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -13,6 +13,9 @@
* must be implemented by each architecture.
*/
+/* arch may override to do additional checking of ELF header architecture */
+bool module_elf_check_arch(Elf_Ehdr *hdr);
+
/* Adjust arch-specific sections. Return 0 on success. */
int module_frob_arch_sections(Elf_Ehdr *hdr,
Elf_Shdr *sechdrs,