Skip to content

module: Don't fail module loading when setting ro_after_init section RO failed

Christophe Leroy linux-modules lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Changes in v1 from the cover letter

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

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3module: Split module_enable_rodata_ro()kernel/module/internal.h kernel/module/main.c kernel/module/strict_rwx.c+13 -70 replies
2/3module: Don't fail module loading when setting ro_after_init section RO failedkernel/module/main.c+4 -30 replies
3/3module: pre-test setting ro_after_init data read-onlykernel/module/main.c kernel/module/strict_rwx.c+5 -20 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDaniel GomezLuis Chamberlain
SeriesR-b
1/3T-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/3] module: Don't fail module loading when setting ro_after_init section RO failed

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(-)
Signature · 1 line
2.47.0