Tags: quic/musl
Tags
hexagon: set up the shadow-call-stack pointer (r19) for new threads Under -fsanitize=shadow-call-stack the compiler reserves r19 as the shadow-stack pointer and every instrumented prologue dereferences it, so r19 must point at a valid shadow stack before any instrumented code runs. The main thread is handled by crt1.o, but a new thread first enters the instrumented start()/start_c11() (via __clone), which would use r19 before anything set it. Guarded by __HEXAGON_SCS_THREADS__ (defined only when building the shadow-call-stack multilib libc): carve a per-thread shadow-call-stack from the low end of the thread's stack mapping -- a quarter of the stack, clamped to [4 KiB, 256 KiB], just above the guard page, and freed with the thread so it does not leak -- record its base in struct start_args, and load it into r19 at the very top of start()/start_c11(). Those two functions are marked no_sanitize so their own prologues do not touch r19 before it is initialised. Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
hexagon: add some missing syscalls up to linux 6.6 Signed-off-by: Alex Rønne Petersen <alex@alexrp.com>
hexagon: zero fp/lr in _start() and __clone() Signed-off-by: Alex Rønne Petersen <alex@alexrp.com>