Skip to content

Instantly share code, notes, and snippets.

@mariasfiraiala
Created July 7, 2022 08:10
Show Gist options
  • Save mariasfiraiala/60389dd16fef0fdc11d7f7972e320a9a to your computer and use it in GitHub Desktop.
Save mariasfiraiala/60389dd16fef0fdc11d7f7972e320a9a to your computer and use it in GitHub Desktop.
Constructor used for Shadow Stack on AArch64
void __attribute__ ((constructor)) __attribute__((no_sanitize("shadow-call-stack"))) setup_x18()
{
void *shadow = malloc(16384);
__asm __volatile ( "mov x18, %0" : : "r" (shadow) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment