Commit Graph

1281 Commits

Author SHA1 Message Date
Hui, Chunyang
95ef2819db Add local attestation demo 2020-03-09 04:17:41 +00:00
Hui,Chunyang
83dfdc4f0f Add explanation for usage of SGX simulation mode 2020-03-07 09:46:31 +00:00
Hui, Chunyang
15ce6efdc0 Add simulation support for Occlum embedded mode demo 2020-03-07 09:45:50 +00:00
Hui,Chunyang
4ebedd9bf5 Improve simulation mode user experience
Simulation mode and hardware mode can both work without rebuild Occlum.
2020-03-07 09:44:49 +00:00
He Sun
06f7763d55 Fix a bug in poll that modifies input fds 2020-03-07 17:37:52 +08:00
He Sun
74fad28938 Add performance profiler for threads and system calls 2020-03-07 17:35:39 +08:00
zongmin.gu
a1e003ebdb Fix two bugs by updating SDK's stack ranges on user/kernel switch
Before this commit, there are two strange bugs:
1. No backtraces are displayed on panic by Rust; and,
2. Thread local storage in Rust sometimes causes panics.

It turns out that the the root cause of the two bugs are the same: Occlum's
patch to Intel SGX SDK that informs SDK about the stack range of the currnet
LibOS user-level thread. The problem about this patch is that it modifies some
fundamental data structures and Rust SGX SDK does not know the modification.
This causes Rust SGX SDK to panic in certain conditions.

To resolve the conflict for good, this commit gets rid of the patch to Intel
SGX SDK by updating SDK's stack ranges upon user/kernel switch.
2020-03-07 08:17:40 +00:00
LI Qing
6f986855e9 Fix the issue that process resource cannot be freed in some cases
If untrusted app calls "occlum_pal_exec" sequentially or concurrently,
Occlum cannot free the resource of the enclave process correctly.
2020-03-02 14:42:19 +00:00
sanqian.hcy
b08f5b9ceb Add support for SGX simulation mode
1. Use arch_prctl to replace RDFSBASE/WRFSBASE
Ptrace can't get right value if WRFSBASE is called which
will make debugger fail in simulation mode. Use arch_prctl
to replace these instructions in simulation mode.

2. Disable the busy thread in exit_group test
exit_group doesn't have a real implementation yet but test
under SGX simulation mode give core dump for exit_group test.
Disable the busy loop thread and the core dump disappear.

3. Add SDK lib path to LD_LIBRARY_PATH
Linker sometims can't find urts_sim and uae_service_sim when
running. Explicitly add path to LD_LIBRARY_PATH when running
occlum command.

Signed-off-by: sanqian.hcy <sanqian.hcy@antfin.com>
2020-03-01 06:42:33 +00:00
LI Qing
045ea46e9f Extend CPUID emulation for Intel Celeron and newer Intel CPUs 2020-02-28 10:53:38 +00:00
LI Qing
bbd4cd9be2 Add fstat() and poll() for the random device 2020-02-27 03:41:05 +00:00
LI Qing
9f1fa883df Fix GDB cannot work in release build 2020-02-26 06:58:18 +00:00
LI Qing
3e81b42912 Add SQLite demo 2020-02-25 11:14:48 +00:00
LI Qing
551fb8f9d8 Add a dummy implementation for file advisory locks
This commits is a dummy implementation of file advisory locks.
Specifically, for regular files, fcntl `F_SETLK` (i.e., acquiring
or releasing locks) always succeeds and fcntl `F_GETLK` (i.e., testing locks)
always returns no locks.
2020-02-25 17:31:02 +08:00
Tate, Hongliang Tian
a6e55881b9 Add ioctls for SGX local attestation 2020-02-19 14:48:12 +00:00
LI Qing
76b90efa8f Fix read_at() in SEFS if offset beyond the end of the file 2020-02-14 08:05:29 +00:00
LI Qing
bd56504b20 Add GDB support for apps running upon Occlum
Please see the "gdb_support" in demos to find out how to
use GDB to debug your apps running upon Occlum.
2020-02-14 07:52:45 +00:00
LI Qing
de904bf628 Refactor the structure of FS subsystem
1. Move the system call handling functions into the "syscalls.rs"
2. Split syscall memory safe implementations into small sub-modules
3. Move the unix_socket and io_multiplexing into "net"
4. Remove some unnecessary code
2020-02-14 06:19:49 +00:00
He Sun
cfa6532768 Fix bugs that fail CentOS Dockerfile 2020-02-14 06:19:48 +00:00
LI Qing
2372ef0d4e Fix make submodule command error 2020-02-10 12:02:23 +00:00
Tate, Hongliang Tian
e96892d348 Update version number to 0.9.0 2020-01-23 10:04:38 +00:00
He Sun
e352a190ea Optimize the perf of sendmsg/recvmsg by allocating untrusted buffers directly
It is slow to allocate big buffers using SGX SDK's malloc. Even worse, it
consumes a large amount of precious trusted memory inside enclaves. This
commit avoids using trusted buffers and allocates untrusted buffers for
sendmsg/recvmsg directly via OCall, thus improving the performance of
sendmsg/recvmsg. Note that this optimization does not affect the security of
network data as it has to be sent/received via OCalls.
2020-01-23 06:58:51 +00:00
Tate, Hongliang Tian
c3d042dcd0 Refactor EDL for adding custom C types easily
Before this commit, using custom C types in ECalls/OCalls defined in Occlum's
EDL is cumbersme. Now this issue is resolved by providing `occlum_edl_types.h`
header file. There are two versions of this file: one is under
`src/libos/include/edl/` for LibOS, the other is under
`src/pal/include/edl/` for PAL. So now to define a new custom C type, just
edit the two versions of `occlum_edl_types.h` to define the type.
2020-01-23 06:58:46 +00:00
Tate, Hongliang Tian
986d1d2e44 Fix ioctl SGX_IOC_GET_EPID_GROUP_ID for EBUSY error
SGX SDK's sgx_init_quote may return SGX_ERROR_BUSY, which is previously not
handled. The implementation of ioctl for /dev/sgx is now fixed to handle this
error.
2020-01-23 04:40:54 +00:00
Tate, Hongliang Tian
c6bcbaf442 Fix some typos 2020-01-23 04:40:54 +00:00
Tate, Hongliang Tian
671da280d8 Add support for compiling C code as well as Rust in release mode
We can now build all source code (.S, .c, and .rs) under `src/` in release
mode with `OCCLUM_RELEASE_BUILD=1 make` command.
2020-01-23 04:40:54 +00:00
LI Qing
d825351f02 Fix potential overflow or underflow of offset in INodeFile's seek 2020-01-23 04:40:54 +00:00
LI Qing
449ba1d5d9 Add Dockerfile for Ubuntu 18.04 2020-01-23 04:40:54 +00:00
He Sun
295d52fbe8 Add pipe support for fcntl's F_GETFL and F_SETFL commands 2020-01-23 04:40:54 +00:00
LI Qing
343c19391a Add Python demo 2020-01-23 04:40:54 +00:00
LI Qing
488ec48fe7 Upgrade Rust SGX SDK and its deps to the latest
1. Upgrade Rust SGX SDK to v1.1.0
2. Upgrade Intel SGX SDK to v2.7.1
3. Upgrade Rust to nightly-2019-11-25
2020-01-23 04:40:54 +00:00
Tate, Hongliang Tian
f2b4e96ed0 Add a demo for the embedded mode 2020-01-23 04:40:54 +00:00
LI Qing
040fe89661 Fix the inet socket file to support fcntl()'s F_GETFL and F_SETFL 2020-01-23 04:40:54 +00:00
Tate, Hongliang Tian
a84803e951 Refactor Occlum PAL as a shared library
By providing Occlum PAL as a shared library, it is now possible to embed and
use Occlum in an user-controled process (instead of an Occlum-controlled one).

The APIs of Occlum PAL can be found in `src/pal/include/occlum_pal_api.h`. The
Occlum PAL library, namely `libocclum-pal.so`, can be found in `.occlum/build/lib`.
To use the library, check out the source code of `occlum-run` (under
`src/run`), which can be seen as a sample code for using the Occlum PAL
library.
2020-01-23 04:40:54 +00:00
LI Qing
61cf75e68b Add readlink from /proc/self/fd/<fd> to get file paths
* Fix readlink from `/proc/self/exe` to get absolute path of the executable file
* Add readlink from`/proc/self/fd/<fd>` to get the file's real path

Note that for now we only support read links _statically_, meaning that even
if the file or any of its ancestors is moved after the file is opened, the
absolute paths obtained from the API does not change.
2020-01-23 04:40:54 +00:00
LI Qing
daed89007a Add fcntl's subcommands: F_GETFL and F_SETFL
* Modify fcntl system call to support F_GETFL and F_SETFL
* Separate OpenFlags to CreationsFlags, AccessMode and StatusFlags
2020-01-23 04:40:54 +00:00
He Sun
ebc158fe6c Add Dockerfile for CentOS 7.2 2020-01-23 04:40:54 +00:00
LI Qing
b610e5b8b8 Fix getdents when the next dir entry cannot fit into the output buffer
The output buffer given to getdents may not be large enough for the next directory
entry. If no directory entries has been loaded into the buffer, just return
EINVAL. Otherwise, return the total length of the directory entries already
loaded in the buffer
2020-01-23 04:40:54 +00:00
He Sun
6d7597c25e Polish gRPC and remote attestation demos
1. Disable zlib _explictly_ when building libcurl in remote attestaion demo.
The reason for this is that zlib may be implictly linked by the build system of
libcurl but not the zlib library is not copied into the Occlum FS image.
2. Use `make -j$(nproc)`
3. Fix typos
2020-01-23 04:40:54 +00:00
danintel
0f08fbf962 Fix README.md: Minor Corrections
Signed-off-by: danintel <daniel.anderson@intel.com>
2020-01-23 12:24:31 +08:00
Tate, Hongliang Tian
fe926ed8b3 Update version to 0.8.0 2019-12-13 12:36:01 +00:00
He Sun
4ab667461e Add gRPC demo
This demo shows how to run gRPC C++ sample client/server on Occlum.
2019-12-13 12:17:55 +00:00
He Sun
0cef5b1b53 Add sendmsg/recvmsg syscalls
1. Add a separate net/ directory for the network subsystem;
2. Move some existing socket code to net/;
3. Implement sendmsg/recvmsg with OCalls;
4. Extend client/server test cases.
2019-12-13 12:00:55 +00:00
Junxian Xiao
2052447950 Add SGX remote attestaion demo
This demo consists of
1. An user-friendly library for getting Intel Attestation Service (IAS) report.
2. A application that uses this library to get IAS report.

This demo requires obtaining service provider certificate/ID from Intel.
2019-12-13 11:56:21 +00:00
LI Qing
b9fa937504 Add Intel OpenVINO demo
This demo shows how to run Intel OpenVINO Inference Engine on Occlum inside SGX enclaves
2019-12-10 06:07:27 +00:00
LI Qing
4ee3396152 Refactor the futex implementation
1. Use multiple futex buckets to reduce lock contention on futex data
strcutures
2. Add FUTEX_REQUEUE support
3. Add the condition variable test case
2019-12-10 06:03:03 +00:00
He Sun
b91566d486 Fix atomic counting in socketpair's bind_until_success 2019-12-07 10:35:27 +00:00
Tate, Hongliang Tian
3c1378b7eb Add ioctls on /dev/sgx for SGX remote attestation
1. Add ioctl command `SGXIOC_GET_EPID_GROUP_ID` for /dev/sgx
2. Add ioctl command `SGXIOC_GEN_QUOTE` for /dev/sgx
3. Add test cases
2019-12-07 10:21:01 +00:00
Tate, Hongliang Tian
7024fa81ec Fix benchmark programs by correcting program paths 2019-12-02 05:55:36 +00:00
Tate, Hongliang Tian
e09c747b84 Fix Dockerfile by using LIBOS_RELEASE=1 2019-12-02 05:55:23 +00:00