Skip to content

arm64: modules: Reject loading of malformed modules

Adrian Barnaś linux-arm-kernel lkml 2 versions – Applied

Status from this message: Applied to arm64 (for-next/fixes), thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesApplied
  2. v12 patches 6 repliesSuperseded

Changes from the cover letter

* Renamed the parameter is_module to skip_dry_run in scs_patch()
* Moved comments to module_finalize() and improve justification
* Instead of rejecting all modules with callback, reject those with cb pointing outside core kernel text
* Replace -EPERM to -ENOEXEC when rejecting modules with incorrect cb
* Fix missing return in apply_alternatives_module() placeholder

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2arch: arm64: Fail module loading if dynamic SCS patching failsarch/arm64/include/asm/scs.h arch/arm64/kernel/module.c arch/arm64/kernel/pi/map_kernel.c +2 more+19 -90 replies
2/2arch: arm64: Reject modules with internal alternative callbacksarch/arm64/include/asm/alternative.h arch/arm64/kernel/alternative.c arch/arm64/kernel/module.c+24 -111 reply

Reviews trailers per patch

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

PatchArd Biesheuvel
SeriesR-b
1/2
2/2

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

Read the v2 thread

Cover letter [PATCH v2 0/2] arm64: modules: Reject loading of malformed modules

Hi all,

Here is version two of the patches I previously posted here:

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

Changes:
* Renamed the parameter is_module to skip_dry_run in scs_patch()
* Moved comments to module_finalize() and improve justification
* Instead of rejecting all modules with callback, reject those with cb pointing outside core kernel text
* Replace -EPERM to -ENOEXEC when rejecting modules with incorrect cb
* Fix missing return in apply_alternatives_module() placeholder

Best regards
Adrian

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Dylan Hatch <[email protected]>
Cc Mark Rutland <[email protected]>

Adrian Barnaś (2):
arch: arm64: Fail module loading if dynamic SCS patching fails
arch: arm64: Reject modules with internal alternative callbacks

 arch/arm64/include/asm/alternative.h |  7 +++++--
 arch/arm64/include/asm/scs.h         |  2 +-
 arch/arm64/kernel/alternative.c      | 19 ++++++++++++-------
 arch/arm64/kernel/module.c           | 21 +++++++++++++++++----
 arch/arm64/kernel/pi/map_kernel.c    |  2 +-
 arch/arm64/kernel/pi/patch-scs.c     | 10 ++++++----
 arch/arm64/kernel/pi/pi.h            |  2 +-
 7 files changed, 43 insertions(+), 20 deletions(-)
Signature · 1 line
2.51.0.534.gc79095c0ca-goog