Skip to content

livepatch,module: Remove .klp.arch and module_disable_ro()

Josh Poimboeuf linux-s390 live-patching lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 14 repliesIn review
  2. v310 patches 12 repliesSuperseded
  3. v29 patches 28 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v17 patches30 repliesSuperseded

Changes in v4 from the cover letter

- Fixed rebase bisection regression [Miroslav]
- Made module_enable_ro() static [Jessica]
- Added Acked-by's

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11livepatch: Disallow vmlinux.kokernel/livepatch/core.c+5 -00 replies
2/11livepatch: Apply vmlinux-specific KLP relocations earlyinclude/linux/livepatch.h kernel/livepatch/core.c kernel/module.c+106 -550 replies
3/11livepatch: Remove .klp.archDocumentation/livepatch/module-elf-format.rst arch/x86/kernel/Makefile arch/x86/kernel/livepatch.c +2 more+11 -880 replies
4/11livepatch: Prevent module-specific KLP rela sections from referencing vmlinux symbolskernel/livepatch/core.c+27 -110 replies
5/11s390: Change s390_kernel_write() return type to match memcpy()arch/s390/include/asm/uaccess.h arch/s390/mm/maccess.c+7 -42 replies
6/11s390/module: Use s390_kernel_write() for late relocationsarch/s390/kernel/module.c+88 -592 replies
7/11x86/module: Use text_poke() for late relocationsarch/um/kernel/um_arch.c arch/x86/kernel/module.c+47 -70 replies
8/11livepatch: Remove module_disable_ro() usagekernel/livepatch/core.c+0 -20 replies
9/11module: Remove module_disable_ro()include/linux/module.h kernel/module.c+0 -150 replies
10/11x86/module: Use text_mutex in apply_relocate_add()arch/x86/kernel/module.c kernel/livepatch/core.c+7 -80 replies
11/11module: Make module_enable_ro() static againinclude/linux/module.h kernel/module.c+2 -87 replies

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJoe LawrenceMiroslav BenesPeter Zijlstra (Intel)Jessica YuGerald Schaefer
SeriesA-b
1/11A-b A-b
2/11A-b A-b A-b
3/11A-b A-b A-b
4/11A-b A-b A-b
5/11A-b A-b A-b
6/11A-b A-b A-b A-b
7/11A-b A-b A-b
8/11A-b A-b A-b
9/11A-b A-b A-b
10/11A-b A-b
11/11A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/11] livepatch,module: Remove .klp.arch and module_disable_ro()

v4:
- Fixed rebase bisection regression [Miroslav]
- Made module_enable_ro() static [Jessica]
- Added Acked-by's

v3:
- klp: split klp_write_relocations() into object/section specific functions [joe]
- s390: fix plt/got writes [joe]
- s390: remove text_mutex usage [mbenes]
- x86: do text_poke_sync() before releasing text_mutex [peterz]
- split x86 text_mutex changes into separate patch [mbenes]

v2:
- add vmlinux.ko check [peterz]
- remove 'klp_object' forward declaration [mbenes]
- use text_mutex [jeyu]
- fix documentation TOC [jeyu]
- fix s390 issues [mbenes]
- upstream kpatch-build now supports this (though it's only enabled for Linux >= 5.8)

These patches add simplifications and improvements for some issues Peter found six months ago, as part of his non-writable text code (W^X) cleanups.

Highlights:

- Remove the livepatch arch-specific .klp.arch sections, which were used to do paravirt patching and alternatives patching for livepatch replacement code.

- Add support for jump labels in patched code (only for static keys which live in vmlinux).

- Remove the last module_disable_ro() usage.

For more background, see this thread:

https://lkml.kernel.org/r/20191021135312.jbbxsuipxldocdjk@treble

This has been tested with kpatch-build integration tests and klp-convert selftests.

Josh Poimboeuf (8):
livepatch: Disallow vmlinux.ko
livepatch: Apply vmlinux-specific KLP relocations early
livepatch: Prevent module-specific KLP rela sections from referencing
vmlinux symbols
s390: Change s390_kernel_write() return type to match memcpy()
livepatch: Remove module_disable_ro() usage
module: Remove module_disable_ro()
x86/module: Use text_mutex in apply_relocate_add()
module: Make module_enable_ro() static again

Peter Zijlstra (3):
livepatch: Remove .klp.arch
s390/module: Use s390_kernel_write() for late relocations x86/module: Use text_poke() for late relocations

 Documentation/livepatch/module-elf-format.rst |  15 +-
 arch/s390/include/asm/uaccess.h               |   2 +-
 arch/s390/kernel/module.c                     | 147 +++++++++------
 arch/s390/mm/maccess.c                        |   9 +-
 arch/um/kernel/um_arch.c                      |  16 ++
 arch/x86/kernel/Makefile                      |   1 -
 arch/x86/kernel/livepatch.c                   |  53 ------
 arch/x86/kernel/module.c                      |  43 ++++-
 include/linux/livepatch.h                     |  17 +-
 include/linux/module.h                        |   8 -
 kernel/livepatch/core.c                       | 177 +++++++++++-------
 kernel/module.c                               |  27 +--
 12 files changed, 279 insertions(+), 236 deletions(-)
 delete mode 100644 arch/x86/kernel/livepatch.c
Signature · 1 line
2.21.1