Commit Graph

454 Commits

Author SHA1 Message Date
He Sun
459ca45ab9 Fix reading extra message in neogotiate_msg 2020-05-15 21:49:26 +08:00
Tate, Hongliang Tian
e1789dc89f Bump version to 0.12.0
Also, update the docs accordingly.
2020-05-15 11:32:44 +00:00
Tate, Hongliang Tian
d91014b417 Add RunE Quick Start doc 2020-05-15 11:32:44 +00:00
He Sun
a0b34c4450 Remove unintentionally added comments 2020-05-15 11:32:14 +00:00
He Sun
9252a1a993 Fix two bugs of ioctl
1. Add length of the argument to the ioctl ocall to guard sgx sdk to do
the copy.
2. Handle non-zero return value of ioctl.
2020-05-15 12:50:31 +08:00
LI Qing
6d72e10fc1 Add Golang toolchain and the demo
This commit provides a modified Go runtime in Docker image.
Now we can build a Go program using `occlum-go`, then run it
in SGX enclaves by Occlum.
The Golang demo demonstrates how to build and run a web server
program written in Go.
2020-05-15 03:02:42 +00:00
Zongmin
0c3466f4ad Add three new occlum commands: start, exec and stop
Usage:
//start the occlum server
occlum start

//execute the command inside occlum
occlum exec [cmd] [-- <args>]

//stop the occlum server
occlum stop
2020-05-15 03:02:42 +00:00
LI Qing
4567b40f22 Fix a bug of zipping symlink files in rcore-fs-fuse 2020-05-15 03:02:42 +00:00
LI Qing
2d34ee349e Add the sigaltstack system call 2020-05-15 03:02:42 +00:00
Hui, Chunyang
255f277f30 Build Occlum tools in SGX simulation mode by default 2020-05-15 03:02:42 +00:00
Hui, Chunyang
0bb1cbfbb5 Add PAL version api 2020-05-15 03:02:42 +00:00
He Sun
f9486bf7a9 Add resource limit check for the number of the fds in poll 2020-05-15 03:02:42 +00:00
zongmin.gu
eca27408be Support user manage stack
Go/Java/JIT code manage their own stack
So we need to help them to handle exception
2020-05-15 03:02:42 +00:00
He Sun
aed572064b Fix potential address-in-use errors in epoll_server test
Wait for all the children to exit before server exits to release all the
resource used by the test.
2020-05-15 03:02:42 +00:00
Zongmin
a6d97d5b4f Update the sdk version to 2.9.1
Fix std::alloc::Alloc not found
The lastest Rust changes the trait to std::alloc::AllocRef.

Update the docker files to support sgx 2.9.1

Remove the compilerRT dependency for rust sdk update
2020-05-15 03:02:42 +00:00
Tate, Hongliang Tian
1d1330772c Add new API occlum_pal_kill
This API enables sending signals to one or multiple LibOS processes from
outside the enclave.
2020-05-15 03:02:42 +00:00
Tate, Hongliang Tian
6e140a0d38 Add errno info for ECalls
Before this commit, the three ECalls of the LibOS enclave do not give
the exact reason on error. In this commit, we modify the enclave entry code
to return the errno and list all possible values of errno in Enclave.edl.
2020-05-15 02:59:16 +00:00
He Sun
1c707eda30 Add support for monitoring epoll fds with epoll 2020-05-15 02:59:16 +00:00
Hui, Chunyang
25350b0e85 Fix sched agent failure for offline core 2020-05-15 02:59:16 +00:00
He Sun
7a87d77509 Fix error when PF_UNIX is passed as protocol to create unix socket
Zero and PF_UNIX are both supported as protocol when creating unix
socket.
2020-05-15 02:59:16 +00:00
Tate, Hongliang Tian
e166382923 Add the signal subsystem
In this commit, we add eight signal-related syscalls
* kill
* tkill
* tgkill
* rt_sigaction
* rt_sigreturn
* rt_sigprocmask
* rt_sigpending
* exit_group

We implement the following major features for signals:
* Generate, mask, and deliver signals
* Support user-defined signal handlers
    * Support nested invocation of signal handlers
    * Support passing arguments: signum, sigaction, and ucontext
* Support both process-directed and thread-directed signals
* Capture hardware exceptions and convert them to signals
* Deliver fatal signals (like SIGKILL) to kill processes gracefully

But we still have gaps, including but not limited to the points below:
* Convert #PF (page fault) and #GP (general protection) exceptions to signals
* Force delivery of signals via interrupt
* Support simulation mode
2020-05-15 02:59:16 +00:00
LI Qing
1172c25677 Modify occlum_entry to be compatible with Linux syscall ABI 2020-05-15 02:59:16 +00:00
Hui, Chunyang
72f2a33e2a Add log level alignment with OCI 2020-05-15 02:59:16 +00:00
He Sun
71475c3e96 Fix wrong assert in recvmsg for MSG_TRUNC flag 2020-05-15 02:59:16 +00:00
He Sun
bbb52f6990 Refine check for pointers from user space and outside enclave
Implement the check functions that are empty before and do some
adjustment where they are called.
2020-05-15 02:59:16 +00:00
LI Qing
614ec88242 Remove tabs in the source files of test cases 2020-05-15 02:59:16 +00:00
LI Qing
1dcabb09cd Fix the access and faccessat system calls 2020-05-15 02:59:16 +00:00
LI Qing
6d27595195 Fix the negative offset check for pread/pwrite 2020-05-15 02:59:16 +00:00
He Sun
48d7f8df3e Fix the invalid epoll_event pointer introduced by compilation optimization
That pointer does not point to the libc::epoll_event after release
build. Explicitly declaring the libc::epoll_event avoids the
invalidation.
2020-05-15 02:59:16 +00:00
Hui, Chunyang
6a17e6292c Add support for user specified instance dir name
The default instance dir of Occlum is ".occlum". User now can specify the name
by declaring environment variable "OCCLUM_INSTANCE_DIR"
2020-05-15 02:59:16 +00:00
LI Qing
03bb09abdf Add the emulation of SYSCALL instruction
1. Refactor the exception handling process
2. Support to emulate the SYSCALL instruction in the exception handler
2020-05-15 02:59:16 +00:00
Hui, Chunyang
79fd6570f5 Change log level to warning for ioctl TIOCGWINSZ 2020-05-15 02:59:16 +00:00
He Sun
aa10d96f89 Fix u32::MAX not found error
Using std::u32 instead of u32 passes the compilation.
2020-05-15 02:59:16 +00:00
He Sun
e651be4403 Fix not passing null pointers to ocalls for empty slices
It gets a non-null fat pointer when an empty slice simply calls as_ptr
or as_mut_ptr.
2020-05-15 02:59:16 +00:00
He Sun
58403f8415 Fix panic when dropping unix socket
When a unix socket only calls function listen, its object is not created
but its status becomes listening. At this time closing the socket would
cause a panic before this commit.
2020-05-15 02:59:16 +00:00
He Sun
9815523a95 Fix panic when there is no enough memory for a new ringbuffer 2020-05-15 02:59:16 +00:00
Hui, Chunyang
490e45a52e Fix git submodule update failure in some environments
Submodules of Occlum may have a very big size and under some environments git submodule
update can always fail. Now OCCLUM_GIT_OPTIONS can read from environment. And user can
specify the depth of the submodule like this: OCCLUM_GIT_OPTIONS="--depth 1" make submodule,
which can make it more possible to succeed.
2020-05-15 02:59:16 +00:00
Hui, Chunyang
5bd5e1bc68 Fix cpuid failed for unprivileged user
Add "-1" to display information only for the current CPU.
2020-05-15 02:59:16 +00:00
Hui, Chunyang
53f8ade4de Fix a typo 2020-05-15 02:59:16 +00:00
yuanwu
ed7f83562a Check the MPX status of platform before enabling
Signed-off-by: yuanwu <yuan.wu@intel.com>
2020-04-26 15:02:26 +08:00
Tate, Hongliang Tian
5b4b72a81a Bump the version number to 0.11.0 2020-04-17 17:52:17 +08:00
Tate, Hongliang Tian
ad077d644a Fix the demo for the embedded mode 2020-04-16 08:46:56 +00:00
Tate, Hongliang Tian
df71872f76 Disable Intel MPX by default
The next generation of Intel CPUs does not support Intel MPX. Enabling MPX
by default crashes the LibOS on startup. So we disable MPX by default. The
long term plan is to turn on/off MPX via compiling options.
2020-04-15 21:25:24 +08:00
Tate, Hongliang Tian
2b556f8de9 Refactor the CPU scheduling subsystem
This commits improves both readability and correctness of the scheduling-related
system calls. In terms of readability, it extracts all scheduling-related code
ouf of the process/ directory and put it in a sched/ directory. In terms
of correctness, the new scheduling subsystem introduces CpuSet and SchedAgent
types to maintain and manipulate CPU scheduler settings in a secure and robust way.
2020-04-15 09:43:38 +00:00
Tate, Hongliang Tian
2a1d3d98c5 Refactor the process/thread subsystem
As a major rewrite to the process/thread subsystem, this commits:
1. Implements threads as a first-class object, which represents a group of OS resources
and a thread of execution;
2. Implements processes as a first-class object that manages threads and maintains
the parent-child relationship between processes;
3. Refactors the code in process subsystem to follow the improved coding style and
conventions emerged in recent commits;
4. Refactors the code in other subsystems to use the new process/thread subsystem.
2020-04-15 06:22:41 +00:00
LI Qing
f9df83f559 Fix the demo's compiling failure in some cases
Some demos based on CMake may search installed packages out of
Occlum toolchain's directory, this could cause some building
errors sometimes. By setting the $PKG_CONFIG_LIBDIR, we can make
CMake searching for packages in Occlum toolchain's directory only.
2020-04-15 14:14:00 +08:00
Hui, Chunyang
3034cb992b Fix cpuid test for non-SGX platforms 2020-04-14 09:43:11 +00:00
Hui, Chunyang
7372d0277c Fix tty ioctl test for non-tty stdout 2020-04-14 06:32:21 +00:00
Hui, Chunyang
0ffc127bff Add travis CI for Occlum 2020-04-13 05:45:02 +00:00
LI Qing
bbc3b8a467 Fix RDTSC emulation's changing app's TLS by mistake
This commit switches from user mode to kernel mode before handling
the exception caused by RDTSC instruction.
2020-04-10 09:53:39 +00:00