[PATCH] arm64/scs: Fix handling of advance_loc4

Ard Biesheuvel ardb at kernel.org
Tue Mar 17 08:00:48 PDT 2026


On Tue, 17 Mar 2026, at 03:36, Pepper Gray wrote:
> I have created a script that configures, builds and runs a rootfs to 
> reproduce the error:
> https://github.com/peppergrayxyz/arm64-scs
>
> I also attached the kernel, amdgpu module and build log as release.
>

Thanks, that is really helpful. I suppose amdgpu.ko ends up with some huge functions after inlining where the distance between instructions that are relevant in terms of unwind data is large enough to require the 32-bit advance opcode.

I should note, though, that the SCS patching logic is really only useful for distro kernels that might run on a wide range of hardware. In the case of Gentoo, I'd expect the shadow call stack to be either enabled or disabled unconditionally, depending on whether the user wants to rely on pointer authentication (PAC) or SCS (or neither). The dynamic behaviour was added mainly to avoid the overhead of running with PAC and SCS enabled at the same time.







More information about the linux-arm-kernel mailing list