linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] module: Don't fail module loading when setting ro_after_init section RO failed
@ 2024-12-05 19:46 Christophe Leroy
  2024-12-05 19:46 ` [PATCH v1 1/3] module: Split module_enable_rodata_ro() Christophe Leroy
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Christophe Leroy @ 2024-12-05 19:46 UTC (permalink / raw)
  To: Luis Chamberlain, Petr Pavlu, Sami Tolvanen, Daniel Gomez,
	Kees Cook, linux-modules
  Cc: Christophe Leroy, linux-kernel, Thomas Gleixner

This series reworks module loading to avoid leaving the module in a
stale state when protecting ro_after_init section fails.

Once module init has succeded it is too late to cancel loading.
If setting ro_after_init data section to read-only fails, all we can
do is to inform the user through a warning. This is what patch 2 does.

Then patch 3 tries to go a bit further by testing the ability to write
protect ro-after-init section prior to initialising the module.

Changes between RFC and v1:
- Patch 2: Fixed comment from Petr about __func__
- Patch 3: Expanded the commit message based on feedback from RFC series

Christophe Leroy (3):
  module: Split module_enable_rodata_ro()
  module: Don't fail module loading when setting ro_after_init section
    RO failed
  module: pre-test setting ro_after_init data read-only

 kernel/module/internal.h   |  3 ++-
 kernel/module/main.c       | 13 +++++++------
 kernel/module/strict_rwx.c | 16 ++++++++++++----
 3 files changed, 21 insertions(+), 11 deletions(-)

-- 
2.47.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-01-08 19:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-05 19:46 [PATCH v1 0/3] module: Don't fail module loading when setting ro_after_init section RO failed Christophe Leroy
2024-12-05 19:46 ` [PATCH v1 1/3] module: Split module_enable_rodata_ro() Christophe Leroy
2024-12-05 19:46 ` [PATCH v1 2/3] module: Don't fail module loading when setting ro_after_init section RO failed Christophe Leroy
2024-12-05 19:46 ` [PATCH v1 3/3] module: pre-test setting ro_after_init data read-only Christophe Leroy
2024-12-11  4:29 ` [PATCH v1 0/3] module: Don't fail module loading when setting ro_after_init section RO failed Luis Chamberlain
2025-01-03 16:13 ` Petr Pavlu
2025-01-04  7:39   ` Christophe Leroy
2025-01-06 14:01     ` Petr Pavlu
2025-01-07  0:13   ` Kees Cook
2025-01-07 13:00     ` Daniel Gomez
2025-01-08 19:17     ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).