@@ -66,7 +66,7 @@ equivalent.
66
66
| Heap corruption protection | Yes | 1.32.0 (2019-01-17) (via operating system default or specified allocator) |
67
67
| Stack smashing protection | Yes | Nightly |
68
68
| 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 |
70
70
71
71
<small id =" fn:1 " >1\. See
72
72
< 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
443
443
protection, such as ARM Pointer Authentication, and Intel Shadow Stack as
444
444
part of Intel CET.
445
445
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 ] .
450
450
451
451
``` text
452
452
$ readelf -s target/release/hello-rust | grep __safestack_init
453
+ 1177: 00000000000057b0 444 FUNC GLOBAL DEFAULT 9 __safestack_init
453
454
```
454
455
Fig. 16. Checking if LLVM SafeStack is enabled for a given binary.
455
456
456
457
The 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
458
459
` __safestack_init ` symbol indicates that LLVM SafeStack is not enabled for a
459
- given binary (see Fig. 16) .
460
+ given binary.
460
461
461
462
<small id =" fn:7 " >7\. The shadow stack implementation for the AMD64
462
463
architecture and equivalent in LLVM was removed due to performance and
@@ -628,3 +629,15 @@ defaults (unrelated to `READ_IMPLIES_EXEC`).
628
629
629
630
42 . bbjornse. “add codegen option for using LLVM stack smash protection #84197 .”
630
631
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