Skip to content

Commit 57fe96f

Browse files
petrpavlumcgrof
authored andcommitted
module: Make .static_call_sites read-only after init
Section .static_call_sites holds data structures that need to be sorted and processed only at module load time. This initial processing happens in static_call_add_module(), which is invoked as a callback to the MODULE_STATE_COMING notification from prepare_coming_module(). The section is never modified afterwards. Make it therefore read-only after module initialization to avoid any (non-)accidental modifications. Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
1 parent a12ef18 commit 57fe96f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

kernel/module/strict_rwx.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ static const char *const ro_after_init[] = {
120120
* section, which are marked as such at module load time.
121121
*/
122122
"__jump_table",
123+
124+
#ifdef CONFIG_HAVE_STATIC_CALL_INLINE
125+
/*
126+
* Section .static_call_sites holds data structures that need to be
127+
* sorted and processed at module load time but are never modified
128+
* afterwards.
129+
*/
130+
".static_call_sites",
131+
#endif
123132
};
124133

125134
void module_mark_ro_after_init(const Elf_Ehdr *hdr, Elf_Shdr *sechdrs,

0 commit comments

Comments
 (0)