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

From: Ard Biesheuvel

Date: Mon Sep 29 2025 - 12:11:03 EST


On Mon, 22 Sept 2025 at 15:04, Adrian Barnaś <abarnas@xxxxxxxxxx> wrote:
>
> Hi all,
>
> Here is version two of the patches I previously posted here:
>
> v1: https://lore.kernel.org/all/20250919122321.946462-1-abarnas@xxxxxxxxxx/
>
> 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 <catalin.marinas@xxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>
> Cc: Dylan Hatch <dylanbhatch@xxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
>
> Adrian Barnaś (2):
> arch: arm64: Fail module loading if dynamic SCS patching fails
> arch: arm64: Reject modules with internal alternative callbacks
>

Reviewed-by: Ard Biesheuvel <ardb@xxxxxxxxxx>