Before this commit, the memory access within `do_init_enclave` setting
`g_enclave_state` to `ENCLAVE_INIT_DONE` was entirely unsynchronized.
This could cause the compiler to reorder this access, performing it
earlier than actually written. This would effectively unlock the memory
being initialized for use within other threads before the initialization
is finished.
The issue isn't entirely theoretical, as such an optimization could for
example allow to make one of the calls to `memset_s` a tailcall. The
only thing preventing this is the difficulty of proving that the memset
doesn't alias `g_enclave_state`.
One way to fix this would be to access `g_enclave_state` with C11
atomics of ordering `acq_rel` or stronger. However, the freestanding
environment of the SDK doesn't support C11 atomics. Thus we use the
existing assembly wrappers, which are sufficient as achieving `acq_rel`
semantics in x86 assembly doesn't require any special instructions.
To make it less likely that a similar flaw is reintroduced, we remove
the `extern` declaration of `g_enclave_state` from the header files.
Signed-off-by: Maja Kądziołka <maya@invisiblethingslab.com>
The proposed change makes it easier to perform unattended installations in e.g. docker containers or VMs.
The `git am` command applies patches and attempts to commit the changes.
Yet, in order to commit git requires `user.name` and `user.email` to be configured, which are both usually not set in containers or VMs.
Based on my testing it is enough to simply apply the patch to avoid git asking for the user's name and email.
Signed-off-by: Muhammad El-Hindi muhammad.el-hindi@cs.tu-darmstadt.com
Along with the latest processor microcode address CVE-2022-21233.
Modified the Switchless library to have mitigations for the associated issue.
Added support for the Linux kernel APIs for the Enclave Dynamic Memory
Management (EDMM) features that are available with the Linux kernel v6.0 or
later. Refer to the SGX SDK developer reference for details on new trusted
APIs and enclave configuration for the EDMM features.
Enabled C++17 within SGX SDK.
Supported AMX (Advanced Matrix Extensions) in Enclave.
Replace hardcoded Enclave signing keys in all sample projects with dynamically
generated keys.
Added a new API to allow user to configure enclave internal cache size in the
Protected File System library.
Upgraded to OpenSSL 1.1.1q and upgraded Intel(R) SGX Quote Verification Enclave
to integrate SgxSSL/OpenSSL version 1.1.1q.
Supported new OS: Ubuntu* 22.04 LTS 64-bit Server version, CentOS* 8.3 64bits,
Red Hat* Enterprise Linux* Server 8.6 (for x86_64), SUSE* Linux* Enterprise
Server 15.4 64bits, Debian* 10 and Anolis* OS 8.6.
Upgraded Intel SGX QE3 to make it backward compatible.
Improved ECDSA quote generation and verification performance by caching PCK
certificates and collaterals in memory and disk drive.
Added Java support for quote verification library.
Added new APIs to unify Intel SGX and TDX quote verification in Quote
Verification Library.
Added Advisory ID in ECDSA quote verification supplemental data.
Added Intel TDX support in RA-TLS (Remote Attestation based TLS) library.
Improved TDX quote generation throughput in vsock mode.
Added Rust support for TDX quote generation.
Fixed bugs.
Signed-off-by: Li, Xun <xun.li@intel.com>
Only threads created inside Enclave have pthread_info_tls.m_pthread set. If some untrusted thread does Ecall and then pthread_self() within Enclave, it will return NULL. This errorneous return value ends up causing thread synchronization errors inside the Enclave.
the current Makefile does not use the special `$(MAKE)` command, instead `make` is hard coded.
This prevents the use of the `-j` flag, making the build slow.
Signed-off-by: Muhammad El-Hindi <muhammad.el-hindi@cs.tu-darmstadt.com>
Along with the latest processor microcode address CVE-2022-21233.
- Modified the Edger8r to generate code with mitigations for the associated issue.
- Modified the API memcpy and memcpy_s to have mitigations for the associated issue.
Signed-off-by: Li, Xun <xun.li@intel.com>
According to the spec [1], the scriptlet %post of a new package executes
before %preun of the old package.
This will cause the startup.sh of the new package to be executed first,
and then the cleanup.sh of the old package to be executed when
sgx-aesm-service is upgraded, and the user aesmd will be deleted,
which leading aesmd booting error.
Replace %post with %posttrans to make sure the prerequisites for service
aesmd are met.
[1]. https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
Signed-off-by: yuguorui <yuguorui@pku.edu.cn>
Along with the latest processor microcode and re-signed all the Intel(R) SGX
Architecture Enclaves (AEs) to address CVE-2022-21123, CVE-2022-21125 and
CVE-2022-21166.
Upgraded to Protobuf 3.20.
Upgraded to SgxSSL/OpenSSL 1.1.1o.
Added Intel TDX Attestation support.
Added Rust support for ECDSA quote verification.
Fixed bugs.
Signed-off-by: Li, Xun <xun.li@intel.com>
Fix sgx_create_enclave retry mechanism when load_enclave
just return SGX_ERROR_MEMORY_MAP_FAILURE. Deprecated the
SGX_ERROR_MEMORY_MAP_CONFLICT. Make the retry mechanism
compatible with new driver and urts.
Signed-off-by: gaoyusong <a869920004@163.com>
Upgraded to OpenSSL 1.1.1m.
Provided RA-TLS (Remote Attestation based Transport Layer Security) APIs and
Samples.
Supported PKRU (Protection Key rights Register) in Enclave.
Added APIs of SHA384 and VerifyReport2 to support TDX.
Enhanced QPL (Quote Provider Library) to support caching Intel PCK
(Provisioning Certificate Key) certificate chain in local memory, or
retrieving Intel PCK cert chain from local HTTP/S address.
Upgraded Intel ECDSA Quote Verification Enclave to integrate SgxSSL/OpenSSL
version 1.1.1m.
Introduced Intel ID enclave for QE identity generation.
Fixed bugs.
Signed-off-by: Li, Xun <xun.li@intel.com>
Updated README
Also revert aesm docker to run as root inside
This was to ensure access to /dev/sgx_provision
Signed-off-by: Haitao Huang <4699115+haitaohuang@users.noreply.github.com>
Detect Nix by probing for the presence of the `NIX_STORE` environment
variable instead of `NIX_PATH`. The latter is only set in a `nix-shell`
session but isn't when building a derivation through `nix-build`. In
contrast, the `NIX_STORE` environment variable is set in both cases.
Signed-off-by: Vincent Haupert <mail@vincent-haupert.de>
* Replace /bin/cp with cp for nix-build
When using nix-build, /bin/cp cannot be found as there's nothing under
/bin except for sh.
Signed-off-by: Sylvain Bellemare <sbellem@gmail.com>
* Call getconf(1) relative to `PATH`
Signed-off-by: Vincent Haupert <mail@vincent-haupert.de>
Co-authored-by: Vincent Haupert <mail@vincent-haupert.de>
This commit ensures that no matter what the order of package installation is,
aesmd can have access to the sgx_provision device file.
Signed-off-by: yuguorui <yuguorui@pku.edu.cn>
Make sure the pthread structures be initialized by PTHREAD_*_INITIALIZER.
Also fix one potential race condition issue.
Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>
Tail call optimization breaks __builtin_return_address in aesm_service.
Add -fno-optimize-sibling-calls to an aesm_service source file to disable it.
Signed-off-by: Li, Xun <xun.li@intel.com>