diff options
author | Petr Pavlu <petr.pavlu@suse.com> | 2025-03-06 14:13:53 +0100 |
---|---|---|
committer | Petr Pavlu <petr.pavlu@suse.com> | 2025-05-18 13:56:21 +0200 |
commit | f7984942630b0508c44276ceaa3a3a47d8fd3d2c (patch) | |
tree | 55f3700ba0c35f2fcb2bf62841a7a677675b7aac /kernel/module/internal.h | |
parent | 7bba3167c08a3bebda6e5fcc0179482b4517ba5b (diff) |
module: Add a separate function to mark sections as read-only after init
Move the logic to mark special sections as read-only after module
initialization into a separate function, along other related code in
strict_rwx.c. Use a table with names of such sections to make it easier to
add more.
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20250306131430.7016-3-petr.pavlu@suse.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'kernel/module/internal.h')
-rw-r--r-- | kernel/module/internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/module/internal.h b/kernel/module/internal.h index e7ab2a2e7a322..8d74b0a21c82b 100644 --- a/kernel/module/internal.h +++ b/kernel/module/internal.h @@ -325,6 +325,8 @@ int module_enable_text_rox(const struct module *mod); int module_enforce_rwx_sections(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, const char *secstrings, const struct module *mod); +void module_mark_ro_after_init(const Elf_Ehdr *hdr, Elf_Shdr *sechdrs, + const char *secstrings); #ifdef CONFIG_MODULE_SIG int module_sig_check(struct load_info *info, int flags); |