@@ -66,7 +66,7 @@ equivalent.
6666| Heap corruption protection | Yes | 1.32.0 (2019-01-17) (via operating system default or specified allocator) |
6767| Stack smashing protection | Yes | Nightly |
6868| Forward-edge control flow protection | Yes | Nightly |
69- | Backward-edge control flow protection (e.g., shadow and safe stack) | No | |
69+ | Backward-edge control flow protection (e.g., shadow and safe stack) | Yes | Nightly |
7070
7171<small id =" fn:1 " >1\. See
7272< https://github.com/rust-lang/rust/tree/master/compiler/rustc_target/src/spec >
@@ -443,20 +443,21 @@ Newer processors provide hardware assistance for backward-edge control flow
443443protection, such as ARM Pointer Authentication, and Intel Shadow Stack as
444444part of Intel CET.
445445
446- The Rust compiler does not support shadow or safe stack. There is work
447- currently ongoing to add support for the sanitizers [ 40 ] , which may or may
448- not include support for safe stack< sup id = " fnref:7 " role = " doc-noteref " ><a
449- href="#fn:7" class="footnote">7</ a ></ sup > .
446+ The Rust compiler supports shadow stack for aarch64 only
447+ < sup id = " fnref:7 " role = " doc-noteref " >< a href = " #fn:7 " class = " footnote " >7</ a ></ sup >
448+ on nightly Rust compilers [ 43 ] - [ 44 ] . Safe stack is available on nightly
449+ Rust compilers [ 45 ] - [ 46 ] .
450450
451451``` text
452452$ readelf -s target/release/hello-rust | grep __safestack_init
453+ 1177: 00000000000057b0 444 FUNC GLOBAL DEFAULT 9 __safestack_init
453454```
454455Fig. 16. Checking if LLVM SafeStack is enabled for a given binary.
455456
456457The presence of the ` __safestack_init ` symbol indicates that LLVM SafeStack
457- is enabled for a given binary. Conversely, the absence of the
458+ is enabled for a given binary (see Fig. 16) . Conversely, the absence of the
458459` __safestack_init ` symbol indicates that LLVM SafeStack is not enabled for a
459- given binary (see Fig. 16) .
460+ given binary.
460461
461462<small id =" fn:7 " >7\. The shadow stack implementation for the AMD64
462463architecture and equivalent in LLVM was removed due to performance and
@@ -628,3 +629,15 @@ defaults (unrelated to `READ_IMPLIES_EXEC`).
628629
62963042 . bbjornse. “add codegen option for using LLVM stack smash protection #84197 .”
630631 GitHub. < https://github.com/rust-lang/rust/pull/84197 >
632+
633+ 43 . ivanloz. “Add support for LLVM ShadowCallStack. #98208 .” GitHub.
634+ < https://github.com/rust-lang/rust/pull/98208 > .
635+
636+ 44 . “ShadowCallStack.” The Rust Unstable Book.
637+ [ https://doc.rust-lang.org/unstable-book/compiler-flags/sanitizer.html#shadowcallstack ] ( ../unstable-book/compiler-flags/sanitizer.html#shadowcallstack ) .
638+
639+ 45 . W. Wiser. “Add support for LLVM SafeStack #112000 ” GitHub.
640+ < https://github.com/rust-lang/rust/pull/112000 >
641+
642+ 46 . “SafeStack.” The Rust Unstable Book.
643+ [ https://doc.rust-lang/org/unstable-book/compiler-flags/sanitizer.html#safestack ] ( ../unstable-book/compiler-flags/sanitizer.html#safestack ) .
0 commit comments