summaryrefslogtreecommitdiff
path: root/crt/aarch64/crti.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2025-07-16 12:04:39 -0400
committerRich Felker <dalias@aerifal.cx>2025-07-16 12:04:39 -0400
commit8fd5d031876345e42ae3d11cc07b962f8625bc3b (patch)
treea5bae5a42887a232fe14433b55eeb40ffdcf5072 /crt/aarch64/crti.s
parent709fee55fd1f83faef91cf0542766da4421424f3 (diff)
downloadmusl-master.tar.gz
aarch64: mask off SME and unknown/future hwcap bitsHEADmaster
as stated in the comment added, the ABI for SME requires libc to be aware of and support the extension to the register file. this is necessary to handle lazy saving correctly across setjmp/longjmp, and on older kernels, in order not to introduce memory corruption bugs that may be exploitable vulnerabilities when creating new threads. previously, we did not expose __getauxval, the interface libgcc uses to determine runtime availability of SME, so it was not usable when following the intended ABI. since commit ab4635fba6769e19fb411a1ab3c8aa7407e11188 has now exposed this interface, a mitigation is needed to ensure SME is not used unless/until we have proper support for it. while SME is the current hwcap feature that needs this treatment, as-yet-undefined hwcap bits are also masked in case other new cpu features have similar ABI issues. this could be re-evaluated at some point in the future. for now, the masking is only on aarch64. arguably it should be considered for all archs, but whether it's needed is really a matter of how ABI policy & stability are handled by the maintainers of the arch psABI, and aarch64 is the one that's demonstrated a necessity. if it turns out something like this is needed for more/all archs, making a generalized framework for it would make sense. for now, it's stuffed into __set_thread_area the same way atomics detection is stuffed there for 32-bit arm and sh, as it's a convenient point for "arch-specific early setup code" without invasive changes.
Diffstat (limited to 'crt/aarch64/crti.s')
0 files changed, 0 insertions, 0 deletions