Re: [PATCH v2 2/2] arm64/module: Use text-poke API for late relocations.

From: Song Liu
Date: Fri May 09 2025 - 12:39:44 EST


Hi Will,

On Fri, May 9, 2025 at 9:15 AM Will Deacon <will@xxxxxxxxxx> wrote:
>
> Hi Dylan,
>
> On Sat, Apr 12, 2025 at 01:09:39AM +0000, Dylan Hatch wrote:
> > To enable late module patching, livepatch modules need to be able to
> > apply some of their relocations well after being loaded. In this
> > scenario, use the text-poking API to allow this, even with
> > STRICT_MODULE_RWX.
> >
> > This patch is largely based off commit 88fc078a7a8f6 ("x86/module: Use
> > text_poke() for late relocations").
> >
> > Signed-off-by: Dylan Hatch <dylanbhatch@xxxxxxxxxx>
> > ---
> > arch/arm64/kernel/module.c | 129 ++++++++++++++++++++++++-------------
> > 1 file changed, 83 insertions(+), 46 deletions(-)
>
> On its own, this isn't gaining us an awful lot upstream as we don't have
> livepatch support (arm64 does not select HAVE_LIVEPATCH), however I'm
> not against incremental changes towards enabling that. Are you planning
> to work on follow-up changes for the rest of the support?

There are two patchsets that are trying to enable HAVE_LIVEPATCH
for arm64:

[1] https://lore.kernel.org/all/20250127213310.2496133-1-wnliu@xxxxxxxxxx/
[2] https://lore.kernel.org/linux-arm-kernel/20250320171559.3423224-1-song@xxxxxxxxxx/

Toshiyuki has tested this patch with both approaches.

Since patchset [1] depends on SFrame, which is less mature at the
moment (clang doesn't support it, kernel side code is very new), live patch
folks think [2] is a better approach at the moment. Could you please share
your thoughts on [2]. If it looks good, we hope to ship it to 6.16 kernels, as
we (Meta) want to use livepatch in our fleet.

Thanks,
Song