Skip to content

arm64: Combine module .init.text with .text

Ard Biesheuvel linux-arm-kernel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3arm64: module: Keep executable init sections in the core text regionarch/arm64/kernel/module.c+33 -00 replies
2/3arm64: Re-enable kernel BTI for compatible linkersarch/arm64/Kconfig+11 -62 replies
3/3arm64: module: Revert separate init PLT and init ftrace trampolinearch/arm64/include/asm/module.h arch/arm64/include/asm/module.lds.h arch/arm64/kernel/ftrace.c +2 more+40 -970 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] arm64: Combine module .init.text with .text

From: Ard Biesheuvel <[email protected]>

This is a follow-up to "arm64: Implement support for BTI veneers" [0] which adds support to the module loader for indirect calls to functions that were emitted by the compiler without a BTI landing pad.

This series takes the ppc approach, and simply combines .init.text with .text when loading modules, so that cross-section calls in the same module (which may originate in the same compilation unit) can never go out of direct branching range.

This makes the BTI veneer solution unnecessary, and permits some other simplifications that were added, even though .init.text and .text rarely end up far away from each other in practice.

Live patch needs additional work, so BTI remains disabled when live patch is enabled. (It expects to be able to make indirect calls to any function in vmlinux or elsewhere, even if they were never exported)

Cc Mark Brown <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Nick Desaulniers <[email protected]>

[0] https://lore.kernel.org/all/[email protected]/

Ard Biesheuvel (3):
arm64: module: Keep executable init sections in the core text region
arm64: Re-enable kernel BTI for compatible linkers
arm64: module: Revert separate init PLT and init ftrace trampoline

 arch/arm64/Kconfig                  | 17 ++--
 arch/arm64/include/asm/module.h     | 11 +--
 arch/arm64/include/asm/module.lds.h |  2 -
 arch/arm64/kernel/ftrace.c          | 13 +--
 arch/arm64/kernel/module-plts.c     | 98 +++++++-------------
 arch/arm64/kernel/module.c          | 46 ++++++---
 6 files changed, 84 insertions(+), 103 deletions(-)
Signature · 1 line
2.56.1.708.g77570a6a1d-goog