You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for LLVM ShadowCallStack.
LLVMs ShadowCallStack provides backward edge control flow integrity protection by using a separate shadow stack to store and retrieve a function's return address.
LLVM currently only supports this for AArch64 targets. The x18 register is used to hold the pointer to the shadow stack, and therefore this only works on ABIs which reserve x18. Further details are available in the [LLVM ShadowCallStack](https://clang.llvm.org/docs/ShadowCallStack.html) docs.
# Usage
`-Zsanitizer=shadow-call-stack`
# Comments/Caveats
* Currently only enabled for the aarch64-linux-android target
* Requires the platform to define a runtime to initialize the shadow stack, see the [LLVM docs](https://clang.llvm.org/docs/ShadowCallStack.html) for more detail.
@@ -513,6 +515,18 @@ To enable this target feature compile with `-C target-feature="+mte"`.
513
515
514
516
More information can be found in the associated [LLVM documentation](https://llvm.org/docs/MemTagSanitizer.html).
515
517
518
+
# ShadowCallStack
519
+
520
+
ShadowCallStack provides backward edge control flow protection by storing a function's return address in a separately allocated 'shadow call stack' and loading the return address from that shadow call stack.
521
+
522
+
ShadowCallStack requires a platform ABI which reserves `x18` as the instrumentation makes use of this register.
523
+
524
+
ShadowCallStack can be enabled with `-Zsanitizer=shadow-call-stack` option and is supported on the following targets:
525
+
526
+
* `aarch64-linux-android`
527
+
528
+
A runtime must be provided by the application or operating system. See the [LLVM documentation][clang-scs] for further details.
529
+
516
530
# ThreadSanitizer
517
531
518
532
ThreadSanitizer is a data race detection tool. It is supported on the following
@@ -610,4 +624,5 @@ Sanitizers produce symbolized stacktraces when llvm-symbolizer binary is in `PAT
0 commit comments