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
Rollup merge of #111722 - mrcnski:stack-protector-doc, r=rcvalle
Document stack-protector option
Only updated `exploit-mitigations.md` to reflect that the option exists. Removed the alternatives mentioned as they are not actually implemented yet.
As this is an unstable feature, should it be added to `unstable-book` also? [Example](https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html). I didn't do that because I couldn't find the tracking issue for stack-protector. (There should be one to track stabilization of the feature, I think?)
cc `@rcvalle`
Copy file name to clipboardexpand all lines: src/doc/rustc/src/exploit-mitigations.md
+9-8
Original file line number
Diff line number
Diff line change
@@ -115,9 +115,9 @@ equivalent.
115
115
<tr>
116
116
<td>Stack smashing protection
117
117
</td>
118
-
<td>No
118
+
<td>Yes
119
119
</td>
120
-
<td>
120
+
<td>Nightly
121
121
</td>
122
122
</tr>
123
123
<tr>
@@ -432,18 +432,16 @@ saved return instruction pointer, and checking if this value has changed
432
432
when returning from a function. This is also known as “Stack Protector” or
433
433
“Stack Smashing Protector (SSP)”.
434
434
435
-
The Rust compiler does not support stack smashing protection. However, more
436
-
comprehensive alternatives to stack smashing protection exist, such as
437
-
shadow and safe stack (see backward-edge control flow protection).
435
+
The Rust compiler supports stack smashing protection on nightly builds[42].
438
436
439
437

440
438
Fig. 14. IDA Pro listing cross references to `__stack_chk_fail` in
441
439
hello-rust.
442
440
443
441
To check if stack smashing protection is enabled for a given binary, search
444
-
for cross references to `__stack_chk_fail`. The only cross references to
445
-
`__stack_chk_fail` in hello-rust are from the statically-linked libbacktrace
446
-
library (see Fig. 14).
442
+
for cross references to `__stack_chk_fail`. The presence of these
443
+
cross-references in Rust-compiled code (e.g., `hello_rust::main`) indicates
444
+
that the stack smashing protection is enabled (see Fig. 14).
447
445
448
446
449
447
### Forward-edge control flow protection
@@ -697,3 +695,6 @@ defaults (unrelated to `READ_IMPLIES_EXEC`).
697
695
698
696
41. “ControlFlowIntegrity.” The Rust Unstable Book.
0 commit comments