Search code examples
linuxarmarm64

Where is the stack canary stored on AArch64?


Is there a special space for ARM64 to store the stack canary, like the %fs:<offset> on x86_64? Where is the thread-local storage (TLS) stored for ARM64?


Solution

  • To the best of my knowledge arm64 Linux kernel is still adopting the old design with StackGuard, using one global canary for the whole kernel (confirmed by this paper.. (Stackguard explanation is here). This line of arm64 Makefile seems to further confirm this.

    About the second question in (arm64) tls.h there is a bunch of definitions for TLS, mainly used in (arm64) process.c.