[PATCH 0/5] aarch64 BTI stub fixes

Szabolcs Nagy szabolcs.nagy@arm.com
Tue Nov 7 13:08:59 GMT 2023


The 11/07/2023 11:38, Nick Clifton wrote:
> Hi Szabolcs,
> 
> > Large binaries with BTI can be linked incorrectly with
> > binutils 2.41 because PR30930.
> > 
> > there are other less critical related issues fixed in
> > this patchset as well.
> > 
> > Szabolcs Nagy (5):
> >    bfd: aarch64: Fix BTI stub optimization PR30957
> >    bfd: aarch64: Fix broken BTI stub PR30930
> >    bfd: aarch64: Fix leaks in case of BTI stub reuse
> >    bfd: aarch64: Avoid BTI stub for a PLT that has BTI
> >    ld: aarch64: Add BTI stub insertion test PR30930
> 
> This patch series looks good to me, so please apply if you have not already done so.
> 
> 
> FYI - I did find one regression in the linker testsuite with the patch applied:
> 
>   FAIL: Check linker stubs with indirect calls handle BTI (exe).
> 
> However there are mitigating circumstances:
> 
>   * The failure was for an unusual toolchain configuration:
> 
>       --target=aarch64_be-linux-gnu_ilp32
> 
>   * The three other tests in this part of the testsuite also fail, both
>     with and without your patch applied:
> 
>       FAIL: Check linker stubs with indirect calls handle BTI (shared lib).
>       FAIL: Check linker stubs with indirect calls handle BTI (exe).
>       FAIL: Check linker stubs with indirect calls handle BTI when target has BTI.
> 
>    Note: there appear to be *two* tests called "check linker stubs with indirect calls handle BTI (exe)."
> 
> I leave it up to you to decide if it is worth fixing these tests.

thanks for looking at this.
i will have to check what's going on.

> PS.  My gut feeling at the moment is that we do not need a 2.41.1 release
> for this patch, since AArch64 systems with BTI enabled are not yet the norm,
> and those that do exist are being used to test for problems like this rather
> than general use.  Since your patch will be in the 2.42 release, due January
> next year, I think that that will be a reasonable timescale for getting the
> fix out there.  Do you agree ?

makes sense,
unless it affects hardened kernel builds.
i will have to check if that's an issue.

thanks.


More information about the Binutils mailing list