Skip to content

Commit 0539523

Browse files
author
Ariel Ben-Yehuda
committed
stack smash protection => stack smashing protection
1 parent ac53917 commit 0539523

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

compiler/rustc_session/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ options! {
21662166
"how to handle split-debuginfo, a platform-specific option"),
21672167
#[rustc_lint_opt_deny_field_access("use `Session::stack_protector` instead of this field")]
21682168
stack_protector: Option<StackProtector> = (None, parse_stack_protector, [TRACKED],
2169-
"control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)"),
2169+
"control stack smashing protection strategy (`rustc --print stack-protector-strategies` for details)"),
21702170
strip: Strip = (Strip::None, parse_strip, [UNTRACKED],
21712171
"tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"),
21722172
symbol_mangling_version: Option<SymbolManglingVersion> = (None,
@@ -2642,7 +2642,7 @@ written to standard error output)"),
26422642
"hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)"),
26432643
#[rustc_lint_opt_deny_field_access("use `Session::stack_protector` instead of this field")]
26442644
stack_protector: Option<StackProtector> = (None, parse_stack_protector, [TRACKED],
2645-
"control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)"),
2645+
"control stack smashing protection strategy (`rustc --print stack-protector-strategies` for details)"),
26462646
staticlib_allow_rdylib_deps: bool = (false, parse_bool, [TRACKED],
26472647
"allow staticlibs to have rust dylib dependencies"),
26482648
staticlib_prefer_dynamic: bool = (false, parse_bool, [TRACKED],

tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-32bit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub fn local_var_addr_used_indirectly(f: fn(bool)) {
114114

115115
// This function takes the address of a local variable taken. Although this
116116
// address is never used as a way to refer to stack memory, the `strong`
117-
// heuristic adds stack smash protection. This is also the case in C++:
117+
// heuristic adds stack smashing protection. This is also the case in C++:
118118
// ```
119119
// cat << EOF | clang++ -O2 -fstack-protector-strong -S -x c++ - -o - | grep stack_chk
120120
// #include <cstdint>
@@ -182,7 +182,7 @@ pub fn local_var_addr_taken_used_locally_only(factory: fn() -> i32, sink: fn(i32
182182

183183
// Even though the local variable conceptually has its address taken, as
184184
// it's passed by reference to the trait function, the use of the reference
185-
// is easily inlined. There is therefore no stack smash protection even with
185+
// is easily inlined. There is therefore no stack smashing protection even with
186186
// the `strong` heuristic.
187187

188188
// all: __security_check_cookie

tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect-windows-64bit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub fn local_var_addr_used_indirectly(f: fn(bool)) {
113113

114114
// This function takes the address of a local variable taken. Although this
115115
// address is never used as a way to refer to stack memory, the `strong`
116-
// heuristic adds stack smash protection. This is also the case in C++:
116+
// heuristic adds stack smashing protection. This is also the case in C++:
117117
// ```
118118
// cat << EOF | clang++ -O2 -fstack-protector-strong -S -x c++ - -o - | grep stack_chk
119119
// #include <cstdint>
@@ -186,7 +186,7 @@ pub fn local_var_addr_taken_used_locally_only(factory: fn() -> i32, sink: fn(i32
186186

187187
// Even though the local variable conceptually has its address taken, as
188188
// it's passed by reference to the trait function, the use of the reference
189-
// is easily inlined. There is therefore no stack smash protection even with
189+
// is easily inlined. There is therefore no stack smashing protection even with
190190
// the `strong` heuristic.
191191

192192
// all: __security_check_cookie

tests/assembly-llvm/stack-protector/stack-protector-heuristics-effect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//@ [none] compile-flags: -C stack-protector=none
1010
//@ compile-flags: -C opt-level=2 -Z merge-functions=disabled
1111

12-
// NOTE: the heuristics for stack smash protection inappropriately rely on types in LLVM IR,
12+
// NOTE: the heuristics for stack smashing protection inappropriately rely on types in LLVM IR,
1313
// despite those types having no semantic meaning. This means that the `basic` and `strong`
1414
// settings do not behave in a coherent way. This is a known issue in LLVM.
1515
// See comments on https://github.com/rust-lang/rust/issues/114903.
@@ -120,7 +120,7 @@ pub fn local_var_addr_used_indirectly(f: fn(bool)) {
120120

121121
// This function takes the address of a local variable taken. Although this
122122
// address is never used as a way to refer to stack memory, the `strong`
123-
// heuristic adds stack smash protection. This is also the case in C++:
123+
// heuristic adds stack smashing protection. This is also the case in C++:
124124
// ```
125125
// cat << EOF | clang++ -O2 -fstack-protector-strong -S -x c++ - -o - | grep stack_chk
126126
// #include <cstdint>
@@ -171,7 +171,7 @@ pub fn local_var_addr_taken_used_locally_only(factory: fn() -> i32, sink: fn(i32
171171

172172
// Even though the local variable conceptually has its address taken, as
173173
// it's passed by reference to the trait function, the use of the reference
174-
// is easily inlined. There is therefore no stack smash protection even with
174+
// is easily inlined. There is therefore no stack smashing protection even with
175175
// the `strong` heuristic.
176176

177177
// all: __stack_chk_fail

tests/assembly-llvm/stack-protector/stack-protector-target-support.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Test that stack smash protection code is emitted for all tier1 and tier2
1+
// Test that stack smashing protection code is emitted for all tier1 and tier2
22
// targets, with the exception of nvptx64-nvidia-cuda
33
//
44
//@ add-core-stubs

0 commit comments

Comments
 (0)