The DCAP SGX driver v1.6+ closely follows the in-kernel SGX driver
v28+. This version changes the driver path to /dev/sgx/enclave and
changes argument struct of the SGX_IOC_ENCLAVE_ADD_PAGE ioctl.
This commit completely reworks VMA subsystem along with its usages.
New version should be: cleaner (easier to maintain), faster and allow
for bookkeeping requests from Pal.
It also fixes some bugs and inconsistencies found in the process and
changes brk and mmap/munmap implementations (at least partially).
New DkAttestationReport() API retrieves the attestation report (local)
from the local attestation mechanism. Currently, it is implemented
only for Linux-SGX PAL and stubbed for all other PALs. The Linux-SGX
implementation retrieves the SGX report via EREPORT instruction.
The caller of this new API may learn sizes of report_data, target_info,
and report structs. The caller may also obtain current target info.
Finally, the caller may obtain the report for use in local attestation.
A simple test case is added to PAL tests.
The DCAP SGX driver works with Flexible Launch Control (FLC) enabled
SGX processors. The FLC feature allows to use arbitrary non-Intel
Launch Enclaves and thus makes the EINITTOKEN struct unnecessary.
This commit skips the step of obtaining the EINITTOKEN struct from
the Launch enclave and instead allows to create a dummy token for
DCAP- and FLC-enabled SGX systems.
Co-authored-by: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>
New DkAttestationQuote() API retrieves the attestation quote from the
underlying host-OS attestation mechanism. Currently, it is implemented
only for Linux-SGX PAL and stubbed for all other PALs. The Linux-SGX
implementation retrieves the SGX quote via sgx_get_quote() which
communicates with the Quoting Enclave via AESM service. The caller of
this new API may forward the obtained quote to the remote user for
remote attestation.
This commit adds the ability to invoke system calls in "exitless" fashion
(aka asynchronously). New manifest option `sgx.rpc_thread_num = X`
instructs Graphene to create X outside-enclave RPC threads that spin-wait
for syscalls (and any OCALLs in general) on a shared queue. In-enclave
threads do not exit the enclave but instead enqueue the syscall in the queue
and wait for it to be processed by an RPC thread. Not to waste CPU resources,
enclave threads first spin (in the hope syscall will return immediately) and
then sleep on a futex.
Omitting `sgx.rpc_thread_num` or setting it to zero defaults to the old way
of executing syscalls: exiting the enclave, executing the syscall, and
re-entering it again.
The exitless feature works with multi-process apps and correctly handles
signals. Two tests of exitless syscalls were added to regression tests.
This does not really belong to /, it is part of documentation. Now it is
called "Development Setup". In the future I'd like this to also include
relevant apt-get and whatever else.
This is a big rewrite of several introduction-level documents. There
were several copies of mostly the same information, but desynchronized
in time. Most of that was split between those files:
- README, now shortened and appropriate for GitHub landing
- index.rst (include README removed)
- building.rst
quickstart.rst was corrected according to building.rst
|nbsp| is so long it breaks reading pace. |~| is shorter and also more
familiar to TeX writers. |nbsp| is still used in GitHub-specific
documents, because GitHub doesn't parse our conf.py.
Previously, Graphene with SGX performed self-remote attestation
by retrieving the SGX quote from the Quoting Enclave, sending it
to the Intel Attestation Service via Curl (in an HTTPS request),
and parsing the received from IAS remote-attestation certificate.
This self-attestation functionality is meaningless and is removed.
Moreover, since EPID-based remote attestation requires client key
(Ocp-Apim-Subscription-Key), and this key must be kept secret,
specifying it in the Graphene manifest (as was done previously) is
insecure. Therefore, the whole remote attestation functionality is
moved out of Graphene and to another trusted party (or to the app
on top of Graphene). Only the SGX quote retrieval from the Quoting
Enclave is kept in Graphene.
Multicast and broadcast functionality was added to Linux and Linux-SGX
PALs in hope that LibOS would use it for distributed consensus. This
never happened, and multicast/broadcast is not used currently.