Skip to content

Commit ff8fe76

Browse files
committed
Auto merge of rust-lang#112646 - vn971:document-thread-names-for-sgx-target, r=m-ou-se
Document thread names for SGX compilation target `@raoulstrackx` `@Mkaynov` `@jethrogb`
2 parents c026d6a + 748e2c6 commit ff8fe76

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

library/std/src/sys/sgx/thread.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,16 @@ impl Thread {
121121
rtassert!(wait_error.kind() == io::ErrorKind::WouldBlock);
122122
}
123123

124+
/// SGX should protect in-enclave data from the outside (attacker),
125+
/// so there should be no data leakage to the OS,
126+
/// and therefore also no 1-1 mapping between SGX thread names and OS thread names.
127+
///
128+
/// This is why the method is intentionally No-Op.
124129
pub fn set_name(_name: &CStr) {
125-
// FIXME: could store this pointer in TLS somewhere
130+
// Note that the internally visible SGX thread name is already provided
131+
// by the platform-agnostic (target-agnostic) Rust thread code.
132+
// This can be observed in the [`std::thread::tests::test_named_thread`] test,
133+
// which succeeds as-is with the SGX target.
126134
}
127135

128136
pub fn sleep(dur: Duration) {

0 commit comments

Comments
 (0)