diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2022-02-23 10:01:00 +0100 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2022-04-05 17:43:04 +0200 |
commit | ef505058dc5524488a84423b4d5e8a7598a23a2e (patch) | |
tree | 335a6a86daae4db2d7bf305df6439fa4bf53dbb6 /kernel/module/internal.h | |
parent | module: Move module_enable_x() and frob_text() in strict_rwx.c (diff) | |
download | linux-ef505058dc5524488a84423b4d5e8a7598a23a2e.tar.xz linux-ef505058dc5524488a84423b4d5e8a7598a23a2e.zip |
module: Rework layout alignment to avoid BUG_ON()s
Perform layout alignment verification up front and WARN_ON()
and fail module loading instead of crashing the machine.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'kernel/module/internal.h')
-rw-r--r-- | kernel/module/internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/module/internal.h b/kernel/module/internal.h index c59473b232df..e94defbeda00 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -180,6 +180,7 @@ void module_enable_nx(const struct module *mod); void module_enable_x(const struct module *mod); int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, char *secstrings, struct module *mod); +bool module_check_misalignment(const struct module *mod); #ifdef CONFIG_MODULE_SIG int module_sig_check(struct load_info *info, int flags); |