Skip to content

Commit 8fc35d0

Browse files
Merge #408 #409
408: Document `TCS` struct limitations r=jethrogb a=raoulstrackx Document that a TCS struct should never be located as the beginning of an enclave. (ref rust-lang/rust#98391) 409: Fix broken link to std library r=jethrogb a=raoulstrackx Co-authored-by: Raoul Strackx <[email protected]>
3 parents 4bbac95 + 96023c2 + 0a7850b commit 8fc35d0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

intel-sgx/fortanix-sgx-abi/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ impl Usercalls {
441441
}
442442

443443
/// The absolute address of a TCS in the current enclave.
444+
///
445+
/// To ensure a TCS struct will never be located at address 0, a TCS struct should not be located
446+
/// at the beginning of an enclave.
444447
// FIXME: `u8` should be some `extern type` instead.
445448
#[cfg_attr(feature = "rustc-dep-of-std", unstable(feature = "sgx_platform", issue = "56975"))]
446449
pub type Tcs = NonNull<u8>;

intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ macro_rules! check_size {
181181
}
182182

183183
impl<'a> LayoutInfo<'a> {
184-
// Check version defined in rust-lang assembly code is supported, see .note.x86_64-fortanix-unknown-sgx section in https://github.com/rust-lang/rust/blob/master/src/libstd/sys/sgx/abi/entry.S
184+
// Check version defined in rust-lang assembly code is supported, see .note.x86_64-fortanix-unknown-sgx section in https://github.com/rust-lang/rust/blob/master/library/std/src/sys/sgx/abi/entry.S
185185
fn check_toolchain_version(elf: &ElfFile<'a>) -> Result<(), Error> {
186186
let note_header = elf.find_section_by_name(".note.x86_64-fortanix-unknown-sgx")
187187
.ok_or_else(|| format_err!("Could not find .note.x86_64-fortanix-unknown-sgx header!"))?;

0 commit comments

Comments
 (0)