Previous implementation of vfork() was both buggy (worked only in simple
cases) and not compatible with the new IPC implementation. We take a
shortcut for now and emulate vfork() via fork(); this is allowed by
POSIX. This commit also adds LibOS regression test for vfork().
* move syscall_nr from shim_context to shim_regs::orig_rax
* move ret_ip from shim_tls to shim_context as clean up
* move sp from shim_context to shim_regs
* context->regs == NULL doesn't make sense for restore_context() because
it doesn't work correctly. It tries to execute 0 address and probably
results in SEGV or something bad.
plus some code clean up and simplification.
Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
Previously, PAL initialized a subset of ELF aux vectors on binary start
and passed them to LibOS. However, LibOS initializes ELF aux vectors on
its own, without consulting PAL's ones. This commit removes the ELF auxv
logic from PAL and simplifies logic in LibOS.
1. Redesign of the VMA bookkeeping logic in the library OS
2. ASLR reimplementation
3. Support MAP_32BITS flags for mmap()
4. Safeguarding library OS internal memory from user memory and checkpoint buffers
5. Eliminating race conditions at VMA lookup and bookkeeping
6. Enable early VMA bookkeeping during initialization
7. Adding documentation for the VMA implementation
Replace the atomics implementation.
* Change the PAL Semaphore to a Mutex, and fix some issues in the Mutex implementations
* Tweak the layout of a PAL Handle
* Rework some of the IPC helper synchronization
* Taking out waitpid03 - it is flaky, even on the commit where it was added to the PASSED list.
* Remove the Linux linked list implementation, replace with a new implementation that adds some type-checking that list pointers (heads) and entries/nodes match.
* Fix the debug build by consolidating assertions into one header
- Fixing AES-CMAC algorithm
- Using SHA512 to hash file stubs (much faster than SHA256 and AES-CMAC)
- Hardening enclave interface (still work-in-progress); delt with issue #28
- Handling socket/pipe polling better
- Allowing setting the lowest heap address in enclaves ('sgx.heap_min' in manifest)
- Fixing the pipe between processes (for SGX)
- Fixing race condition in futex handling in LibOS
- Inheriting epoll handles in forked chilren
- Assigning signal code (now only hard-coding FPE_INTDIV, BUS_ADRERR, SEGV_ACCERR, SEGV_MAPERR)
- Fixing race condition in vma allocation (likely to fix bug() in bookkeep/shim_vma.c)
- Clearer debug message in LibOS
- Fixing calling convention in LibOS and glibc
- Fixing futex behavior (FUTEX_WAIT takes relative time, FUTEX_WAIT_BITSET takes absolute time)
- More system call implemented
- More application working (NGINX)
- Bugfixes in PAL and SHIM
- Improvement of migration scheme in SHIM, which largely speed up
forking
- Upgrade glibc to 2.19
- FreeBSD port
- Support OpenJDK, python and R