Re-enable CONFIG_SHADOW_CALL_STACK once GCC 15 arm_neon.h pragma issue is fixed #20
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
linux-pinetab2-danctnix-besserpkgrel=2 ships withCONFIG_SHADOW_CALL_STACK=nas a temporary workaround for a GCC 15.2.1 toolchain issue. This issue tracks re-enabling SCS once GCC upstream is fixed so we don't carry the security-hardening regression indefinitely.What SCS is + why we want it back
CONFIG_SHADOW_CALL_STACKis an arm64 kernel-hardening feature. The compiler reserves registerx18as a pointer to a parallel "shadow stack" that holds only return addresses. Stack-buffer-overflow / ROP attacks that rewrite the saved return address on the main stack trigger a mismatch and oops instead of jumping to attacker-controlled code. Cost: one register lost to general use, ~1-2% perf hit, ~10 KB per task. Cheap protection; the danctnix default has it on.What's broken right now
Building this kernel on boltzmann (GCC 15.2.1) with
CONFIG_SHADOW_CALL_STACK=yfails inarch/arm64/lib/xor-neon.c:The error fires inside arm_neon.h at every
#pragma GCC pop_optionsthat closes a#pragma GCC target("+nothing+aes")-style block. GCC 15's validator strict-checks SCS↔x18 compatibility after the pop, but the surrounding kernel-file CFLAGS already have both-ffixed-x18and-fsanitize=shadow-call-stackset correctly (verified in the.xor-neon.o.cmdcache).The
target(...)pragma seemingly doesn't carry-ffixed-x18through the push/pop boundary, so on pop GCC thinks the option pair is inconsistent.The bug surfaces on
arch/arm64/lib/xor-neon.c(the only file in the arm64 lib that includes<asm/neon-intrinsics.h>); kernel-side it's#include-only — no clever pragma manipulation on our part.Web-search verdict (2026-05-18)
arm_neon.h+#pragma target+ SCS interaction. Possibly because:-ffixed-x18Workarounds tried during the Phase 6 build (2026-05-18)
-ffixed-x18back toCFLAGS_xor-neon.o.xor-neon.o.cmd) but still fails inside arm_neon.h pragma-fno-sanitize=shadow-call-stacktoCFLAGS_xor-neon.oCFLAGS_REMOVE_xor-neon.o += -fsanitize=shadow-call-stackCONFIG_SHADOW_CALL_STACKin .configAction items
CONFIG_SHADOW_CALL_STACK=yagainst current Arch ARM GCC. Once the build succeeds, flip the config and re-deploy.arm_neon.hreproducer can be extracted, file upstream GCC bug with full target-pragma context. Look first at PR target/119099 territory or whatever the latest target-validator hardening was.arch/arm64/include/asm/neon-intrinsics.h's<arm_neon.h>include with explicit#pragma GCC target("+ffixed-x18")or similar), evaluate and adopt.marfrit/kernel-agent#5) should carry forward the SCS-off override; remember to clear it once GCC is fixed so the manifest doesn't pin the regression.References
reference_arm64_scs_arm_neon_gcc15— verbose copy of this analysis + workaround historyproject_bes2600_c5x_deployed— Patch I row, SCS-off caveatmarfrit/besserclaude-noether-14branch,danctnix-besser-pkgbuild/kernel/confighas# CONFIG_SHADOW_CALL_STACK is not setas of pkgrel=2marfrit/kernel-agent#5(PKGBUILD migration into kernel-agent flow)