about summary refs log tree commit diff
path: root/src/libstd/sys/sgx
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-5201/+0
2020-07-23Rollup merge of #74141 - euclio:typos, r=steveklabnikManish Goregaokar-1/+1
libstd/libcore: fix various typos
2020-07-16Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogbManish Goregaokar-27/+213
Enable some timeouts in SGX platform This would partially resolve https://github.com/fortanix/rust-sgx/issues/31 cc @jethrogb and @Goirad
2020-07-15Move usercall_wait_timeout to abi::usercalls::wait_timeoutMohsen Zohrevandi-82/+74
2020-07-14Rollup merge of #74263 - RalfJung:thread-local, r=Mark-SimulacrumManish Goregaokar-1/+1
Slight reorganization of sys/(fast_)thread_local I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor. So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.
2020-07-14Rollup merge of #73866 - Goirad:fix-entry-improper-ctypes, r=davidtwcoManish Goregaokar-3/+5
Obviate #[allow(improper_ctypes_definitions)] Modifies the return type for `fn entry` so that allowing improper_ctypes_definitions is no longer necessary. This change is derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs` with `UsercallReturn`. cc @jethrogb
2020-07-12adjust remaining targetsRalf Jung-1/+1
2020-07-10Address review commentsMohsen Zohrevandi-39/+34
2020-07-09libstd/libcore: fix various typosAndy Russell-1/+1
2020-07-01Remove unnecessary check in SGX wait usercallMohsen Zohrevandi-2/+1
2020-06-29Obviate #[allow(improper_ctypes_definitions)]Dario Gonzalez-3/+5
Modifies the return type for `fn entry` so that allowing improper_ctypes_definitions is no longer necessary. This change is derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs` with `UsercallReturn`.
2020-06-26Rollup merge of #72937 - AdrianCX:master, r=nikomatsakisManish Goregaokar-5/+9
Fortanix SGX target libunwind build process changes Ticket: https://github.com/fortanix/rust-sgx/issues/174 LLVM related changes (merged): https://github.com/rust-lang/llvm-project/pull/57 Description: libunwind changes needed to run code in sgx environment via rust-sgx. Target that uses this in rust: x86_64-fortanix-unknown-sgx. Without this change, rust std for this toolchain is forced to use a precompiled library loaded via environment variable. With this change we act the same as musl target.
2020-06-24lints: add `improper_ctypes_definitions`David Wood-0/+1
This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: David Wood <david@davidtw.co>
2020-06-24Update libunwind build process for x86_64-fortanix-unknown-sgx targetAdrian Cruceru-5/+9
2020-06-19Using xsave restore to restore complete FPU stateRaoul Strackx-12/+1
2020-06-18Improve wait_timeout_sgx, simplify usercalls::waitMohsen Zohrevandi-28/+56
2020-06-18Prevent attacker from manipulating FPU tag word used in SGX enclaveRaoul Strackx-0/+7
Insufficient sanitization of the x87 FPU tag word in the trusted enclave runtime allowed unprivileged adversaries in the containing host application to induce incoherent or unexpected results for ABI-compliant compiled enclave application code that uses the x87 FPU. Vulnerability was disclosed to us by Fritz Alder, Jo Van Bulck, David Oswald and Frank Piessens
2020-06-12Handle spurious wakeups in wait_timeout_sgxMohsen Zohrevandi-6/+14
2020-06-12Enable some timeouts in SGX platformMohsen Zohrevandi-15/+179
This would partially resolve https://github.com/fortanix/rust-sgx/issues/31
2020-06-07Enable LVI hardening for x86_64-fortanix-unknown-sgxJethro Beekman-5/+15
2020-05-17abort_internal is safeRalf Jung-2/+2
2020-04-26Fix stragglersSteven Fackler-1/+1
2020-04-26Update nameSteven Fackler-9/+9
2020-04-26Add Read/Write::can_read/write_vectoredSteven Fackler-0/+36
When working with an arbitrary reader or writer, code that uses vectored operations may end up being slower than code that copies into a single buffer when the underlying reader or writer doesn't actually support vectored operations. These new methods allow you to ask the reader or witer up front if vectored operations are efficiently supported. Currently, you have to use some heuristics to guess by e.g. checking if the read or write only accessed the first buffer. Hyper is one concrete example of a library that has to do this dynamically: https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594
2020-04-02Remove unnecessary stack overflow handler stub for sgx.Vytautas Astrauskas-8/+0
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-3/+3
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-21Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfacklerDylan DPC-1/+1
Fix abort-on-eprintln during process shutdown This commit fixes an issue where if `eprintln!` is used in a TLS destructor it can accidentally cause the process to abort. TLS destructors are executed after `main` returns on the main thread, and at this point we've also deinitialized global `Lazy` values like those which store the `Stderr` and `Stdout` internals. This means that despite handling TLS not being accessible in `eprintln!`, we will fail due to not being able to call `stderr()`. This means that we'll double-panic quickly because panicking also attempt to write to stderr. The fix here is to reimplement the global stderr handle to avoid the need for destruction. This avoids the need for `Lazy` as well as the hidden panic inside of the `stderr` function. Overall this should improve the robustness of printing errors and/or panics in weird situations, since the `stderr` accessor should be infallible in more situations.
2020-03-20Fix abort-on-eprintln during process shutdownAlex Crichton-1/+1
This commit fixes an issue where if `eprintln!` is used in a TLS destructor it can accidentally cause the process to abort. TLS destructors are executed after `main` returns on the main thread, and at this point we've also deinitialized global `Lazy` values like those which store the `Stderr` and `Stdout` internals. This means that despite handling TLS not being accessible in `eprintln!`, we will fail due to not being able to call `stderr()`. This means that we'll double-panic quickly because panicking also attempt to write to stderr. The fix here is to reimplement the global stderr handle to avoid the need for destruction. This avoids the need for `Lazy` as well as the hidden panic inside of the `stderr` function. Overall this should improve the robustness of printing errors and/or panics in weird situations, since the `stderr` accessor should be infallible in more situations.
2020-03-14Rollup merge of #69403 - LeSeulArtichaut:copy-ioslice, r=sfacklerYuki Okushi-0/+1
Implement `Copy` for `IoSlice` Resolves #69395 r? @sfackler
2020-03-06fix various typosMatthias Krüger-1/+1
2020-02-23Implement `Copy` for `IoSlice`LeSeulArtichaut-0/+1
2020-02-13Add comment to SGX entry codeJethro Beekman-0/+1
2020-02-13Rollup merge of #69068 - Goirad:make-sgx-arg-cleanup-nop, r=jethrogb,nagisaDylan DPC-6/+1
Make the SGX arg cleanup implementation a NOP fixes #64304 cc @jethrogb
2020-02-12Rollup merge of #69040 - jethrogb:jb/cleanup-sgx-entry, r=nagisaDylan DPC-10/+29
Cleanup SGX entry code cc @aandyl
2020-02-11make the sgx arg cleanup implementation a no opDario Gonzalez-6/+1
2020-02-10Avoid jumping to Rust code with user %rsp (reentry_panic)Jethro Beekman-7/+6
2020-02-10sanitize MXCSR/FPU control registersRaoul Strackx-0/+11
2020-02-10Corrected ac_mitigation patch. That patch used the untrusted stack to clear ↵Raoul Strackx-7/+16
rflags during enclave (re-)entry
2020-02-10Fix SGX RWLock representation for UnsafeCell niche fixJethro Beekman-11/+13
2020-01-26updatecomet-1/+1
2020-01-10make use of pointer::is_nullLzu Tao-1/+1
2019-12-24Deprecate Error::description for realDavid Tolnay-0/+2
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-24x.py fmt after previous deignoreMark Rousskov-5/+3
2019-12-22Format the worldMark Rousskov-121/+75
2019-12-06Rewrite %rax register before syscall because it is overwritten by the ↵Pieter Agten-2/+2
syscall itself
2019-12-05Processed review commentsPieter Agten-7/+17
2019-12-04Create a separate entry point for the ELF file, instead of using the SGX ↵Pieter Agten-0/+20
entry point
2019-11-29Format libstd/sys with rustfmtDavid Tolnay-252/+270
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/sys *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/sys -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/sys outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-11-13Revert "Auto merge of #65134 - ↵Robin Kruppe-4/+0
davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe" This reverts commit 3f0e16473de5ec010f44290a8c3ea1d90e0ad7a2, reversing changes made to 61a551b4939ec1d5596e585351038b8fbd0124ba.
2019-11-05libstd: allow `improper_ctypes` in `sys/sgx`David Wood-0/+4
Signed-off-by: David Wood <david@davidtw.co>