Re: [PATCH v2 1/2] arm64: module: Emit BTI veneers for cross-section calls
From: Catalin Marinas
Date: Wed Nov 18 2026 - 12:15:07 EST
On Thu, Nov 12, 2026 at 12:11:02PM +0100, Ard Biesheuvel wrote:
> On Wed, 4 Nov 2026, at 17:28, Catalin Marinas wrote:
> > Apart from those, I don't have other technical objections to the patch
> > but I wonder whether we'll find alternative options going forward that
> > make this fix redundant. E.g. allocating .init.text and .text together
> > (you had an RFC) or a new execmem_alloc_near() to try to place them
> > nearby.
> >
> > In the meantime, would something like the following work for us instead
> > of the veneers? We won't free the .init.text module section but this
> > should be small. There's the ppc64 precedent.
> >
> > bool module_init_section(const char *name)
> > {
> > if (system_supports_bti_kernel() && strstarts(name, ".init.text"))
> > return false;
> >
> > return strstarts(name, ".init");
> > }
> >
>
> I've done an experiment to simply combine these unconditionally, and the
> impact on module .text footprint on a typical config is negligible (~10k
> per 100 loaded modules). That would make this change unnecessary, and would
> allow the init PLTs and init ftrace trampoline to be dropped as well.
I forgot about this thread. Thanks for testing. That's fine by me to
make it unconditional. Would you mind respinning with the above? I guess
we still need the Kconfig checks.
Thanks.
--
Catalin