Skip to content

Commit

Permalink
Merge #408 #409
Browse files Browse the repository at this point in the history
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 <raoul.strackx@fortanix.com>
  • Loading branch information
bors[bot] and raoulstrackx authored Sep 5, 2022
3 parents 4bbac95 + 96023c2 + 0a7850b commit 8fc35d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions intel-sgx/fortanix-sgx-abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ impl Usercalls {
}

/// The absolute address of a TCS in the current enclave.
///
/// To ensure a TCS struct will never be located at address 0, a TCS struct should not be located
/// at the beginning of an enclave.
// FIXME: `u8` should be some `extern type` instead.
#[cfg_attr(feature = "rustc-dep-of-std", unstable(feature = "sgx_platform", issue = "56975"))]
pub type Tcs = NonNull<u8>;
Expand Down
2 changes: 1 addition & 1 deletion intel-sgx/fortanix-sgx-tools/src/bin/ftxsgx-elf2sgxs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ macro_rules! check_size {
}

impl<'a> LayoutInfo<'a> {
// 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
// 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
fn check_toolchain_version(elf: &ElfFile<'a>) -> Result<(), Error> {
let note_header = elf.find_section_by_name(".note.x86_64-fortanix-unknown-sgx")
.ok_or_else(|| format_err!("Could not find .note.x86_64-fortanix-unknown-sgx header!"))?;
Expand Down

0 comments on commit 8fc35d0

Please sign in to comment.