Commit Graph
27 Commits
Author SHA1 Message Date
Isaku Yamahata bc715c2081 [LibOS] Fix memory leak in shim_do_execve_rtld()
__libcc_tcb_t is leaked. It should be allocated from stack.
2019-08-13 20:47:34 +02:00
Isaku Yamahata 12e9eb0c63 [LibOS] Omit field thread.dummy if ALIAS_VFORK_AS_FORK is defined 2019-07-23 01:03:51 -07:00
Dmitrii Kuvaiskii ea234412c9 [LibOS] Emulate vfork() via fork()
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().
2019-07-19 01:03:41 -07:00
Don Porter 27213b18e0 [LibOS] Fix compilation errors with -Wunused-parameter flags 2019-06-26 18:47:13 -07:00
Isaku Yamahata 5564cb0a50 [LibOS] Reorganize fields in shim_context, shim_regs, and shim_tls
* 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>
2019-06-18 15:26:18 -04:00
Chia-Che Tsai be9852784f [All components] Remove all modelines from all source files 2019-06-07 15:30:43 -05:00
Dmitrii Kuvaiskii 4ddca71177 [Pal, LibOS] Remove passing of ELF aux vectors from PAL to LibOS
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.
2019-06-06 13:49:24 -07:00
Michał Kowalczyk 46f553fe5d Cleanup and uppercase C macros 2019-05-23 19:14:23 +02:00
Michał Kowalczyk 1076fd4fa0 [LibOS] Use struct shim_lock instead of LOCKTYPE 2019-05-23 19:13:31 +02:00
Isaku Yamahata 45db924d83 [LibOS] Replace void* with shim_tcb_t/__libc_tcb_t/shim_thread 2019-05-16 12:46:49 -07:00
Chia-Che Tsai 09ad502c3a [LibOS] Use the C11 standard instead of GNU99 2019-05-01 20:43:04 -05:00
Isaku Yamahata 86897c7049 [LibOS] Align stack on 16B during user executable start
x86-64 ABI requires 16B alignment of stack on function calls.
To conform to ABI, align stack when jumping to the entry point
of the user executable.
2019-04-29 15:28:22 -07:00
Isaku Yamahata 315c7b60ff [LibOS] Use static inline function instead of C macro 2019-04-25 19:18:54 +02:00
Isaku Yamahata 9c398764ce [LibOS] shim_thread.h/shim_tls.h: use static inline instead of macro
Macros are used unnecessarily. Use static inline functions instead.

Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
2019-04-09 01:49:29 +02:00
Chia-Che Tsai 0ba556c118 [LibOS] Fixing signal handling scheme 2018-12-03 15:07:38 -08:00
Chia-Che Tsai f8bf469018 Cleaning up and rewriting VMA bookkeeping code (#183)
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
2018-04-16 08:47:50 -07:00
Don Porter d04f172e89 Replace the atomics implementation (#83)
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.
2017-12-07 11:30:48 -08:00
Don Porter 2e9438f71c Replace Linux List code with a new implementation (#71)
* 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
2017-10-21 13:35:26 +01:00
Don Porter 7d98e8ca28 Debug waitpid tests (partially): Fix exit status wrt signals, support nlink in the chroot fs. We don't currently support core dumps from graphene, so some waitpid tests will fail for this reason. 2017-04-07 12:58:19 -04:00
Chia-Che Tsai 76967f39d3 Bugfixes:
- 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)
2017-02-11 09:03:47 -05:00
Don Porter 872af4984c Futex bugfixes (may help #40), more enhancements to LTP framework. 2017-01-28 16:14:30 -05:00
Chia-Che Tsai b6e06b5f79 - add linux-test-project to apps
- add memcached to apps
- merge #33
- merge #35
- fix futex() implementation in libOS
- fix partial alarm() implementation in libOS
- fix memory corruption in handle_map
- correct DkNotificationEventCreate usage
- add syscall chown()
- add syscall rt_sigsuspend()
- add syscall fchownat()
- fix getrlimit() implementation in libOS
- add syscall setrlimit()
- add ioctl(FIONBIO) implementation
- fix partial polling behavior
- implement AF_UNSPEC for sockets
- implement ipv4 mapped ipv6 addresses
- use AES-NI for encryption in SGX PAL
- rewrite mutex implementation in Linux PAL and SGX PAL
- rewrite exception handling in Linux PAL and SGX PAL
- fix issue #27
2017-01-14 07:43:32 -05:00
Chia-Che Tsai cfa620e24a Trivial changes 2016-02-10 21:59:05 -05:00
Chia-Che Tsai b5586bbfc6 release v0.3
- 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
2015-11-30 08:38:50 -05:00
Chia-Che Tsai 328ca4af9b tons of bugfixes 2015-03-31 14:29:34 -04:00
Chia-Che Tsai 5eaaf9abfb apply multiple patches 2015-02-12 20:13:00 -08:00
Chia-Che Tsai 10c06ad723 The first official release 2014-06-02 12:45:42 -04:00