Commit Graph
481 Commits
Author SHA1 Message Date
Li Lei 30e0b8bfba [PAL/Linux-SGX] Reuse TLS/TCS pages for newly created threads after previous threads exit 2019-08-16 18:17:24 -07:00
Isaku Yamahata a3e0aba7ec [LibOS] Use $(MAKE) for sub-makes instead of raw make in LibOS/shim/Makefile 2019-08-16 13:36:30 -07:00
Isaku Yamahata b82d838b7e [LibOS] Remove setting PARALELLMFLAGS for Glibc build
Previously, PARALLELMFLAGS variable caused warnings during Glibc build:
"-jN forced in submake: disabling jobserver mode". Since make supports
the jobserver such that passing -jN to parent make automatically allows
its child make to parallelize its jobs, we do not have to pass -j flags
to the child make.
2019-08-16 13:36:30 -07:00
Michał Kowalczyk 09907126ed [LibOS] test/apps: Fix up apache and lighttpd tests 2019-08-16 02:33:34 +02:00
Chia-Che Tsai dc8b63ce62 [Glibc] Update Glibc version to 2.23 and 2.27
Previously, Graphene supported Glibc version 2.19 only. This commit
adds support for Glibc v2.23 (default in Ubuntu 16.04) and Glibc
v2.27 (default in Ubuntu 18.04). The exact version can be chosen by
specifying GLIBC_VERSION during Graphene build. The default version
to be built is v2.27.

Note that for the best GDB experience it is advised to build Graphene
with the same Glibc version as installed on the host OS.
2019-08-15 13:30:53 -07:00
Isaku Yamahata 072f1bbb8a [LibOS] test/native: Remove static.c and pie.c
Those tests are duplicates of regression/bootstrap_static.c and
regression/bootstrap_pie.c.
2019-08-15 14:31:03 +02:00
Isaku Yamahata 0cb0db9e35 [LibOS] regression: Run bootstrap_static and bootstrap_pie
Add bootstrap_static for SGX and bootstrap_pie tests to test_libos.py as
they now work correctly (after adding VDSO support).
2019-08-15 14:31:03 +02:00
Isaku Yamahata e8cbd4a50a [LibOS] test/regression: Clean up Makefile to use Makefile.rules 2019-08-15 14:31:03 +02:00
Isaku Yamahata 350b522263 [LibOS/Glibc] Remove Glibc modification which disabled vDSO
vDSO is supported by Graphene now, so this commit removes the
modification of Glibc which disabled vDSO in Graphene. Currently,
compile-time option GLIBC_DISABLE_VDSO is introduced to be able
to revert to the old behaviour (disabled by default).
2019-08-14 18:51:59 -07:00
Dmitrii Kuvaiskii 61882a1c4c [LTP] Update submodule to reference improved-timeout asyncio02 2019-08-14 17:54:32 -07:00
Isaku Yamahata 5f5bc5af56 [Pal, LibOS] Consolidate elf.h
There is no point in keeping the same elf.h in both Pal and LibOS.
2019-08-14 01:47:57 +02:00
Simon Gaiser 2c340b75d5 [Makefile] Check vdso.so only when it has been built 2019-08-14 00:50:29 +02:00
Simon Gaiser 517be2a241 [LibOS,Pal] Improve recursive Make calls
Do not declare the result of the recursive Make call as "phony" to avoid
unnecessary rebuilds. Due to the missing dependency information we of
course still need to always recurse.
2019-08-14 00:44:17 +02:00
Simon Gaiser 64e46adcc0 [Makefile] Use generated header dependencies
Fixes #189.
2019-08-14 00:44:17 +02:00
Simon Gaiser 1ff85d10a3 [Makefile] Move building of tests to a separate target
Fixes #204.
2019-08-14 00:44:17 +02:00
Simon Gaiser 4e33068678 [Makefile] Drop unused targets 2019-08-14 00:44:17 +02:00
borysp 004c2fe9a4 [LibOS] Remove opened reference counter from struct shim_handle
Inside `struct shim_handle` `opened` reference counter is used incorrectly.
Additionally at this moment it guards the same resource (handle) as `ref_counter`,
making it obsolete. This patch removes `opened` counter and moves `close_handle`
logic into `put_handle`.
2019-08-13 16:20:44 -07:00
Isaku Yamahata a9681fd20c [LibOS] Do not queue unmasked SIG_IGN'ed signals to prevent memory leak
When signal is unmasked and its handler is SIG_IGN, this signal must not
be queued, otherwise such queued but unused signals result in memory leak.
Additionally, SIGCHLD signal can be discarded even if it is unmasked. For
reference, see Linux code (do_notify_parent() @ linux/kernel/signal.c).
2019-08-13 15:47:54 -07:00
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 1e977ecc71 [LibOS] shim_do_execve_rtld(): defer disabling preemption
Defer disabling preemption until a point of no-return. Otherwise on
return path the function can return with preemption disabled.
2019-08-13 20:47:34 +02:00
Isaku Yamahata 2a54d1915b [LibOS] Remove PARALLELMFLAGS hack from buildglibc.py
Remove PARALLELMFLAGS replacing logic from buildglibc.py and instead use
$(MAKE) PARALLELMFLAGS="-j `nproc`"
2019-08-13 19:03:47 +02:00
Chia-Che Tsai f2591790d7 [LibOS] Fix timeout resolution for epoll_wait()/epoll_pwait()
Internal LibOS and PAL interfaces use microseconds (us) for timeout
values. However, Linux epoll_wait/epoll_pwait syscalls use milliseconds
(ms) for timeout. Previously, there was a bug in timeout resolution
because epoll_wait() emulation did not convert from ms to us. This
commit fixes this bug and also adds suffixes "_ms" and "_us" to make the
time units used explicit.
2019-08-08 17:37:39 -07:00
Isaku Yamahata 0031ef90c8 [LibOS] Make regression/getsockopt return 0 on success
Previously, `rv` was uninitialized in case of success.
2019-08-02 22:49:53 +02:00
borysp 56f93d3a9f [Pal/Linux-SGX] Fix allowed_files subdirectory check
If the path of allowed directory in a manifest file ended with a '/'
e.g. "sgx.allowed_files.tmp_dir = file:tmp/" anything inside it was
disallowed due to a buggy subdirectory check
2019-08-02 22:05:12 +02:00
borysp dbbaec749e [LibOS/tests] Enable large directory read regression test 2019-08-02 22:05:12 +02:00
Isaku Yamahata 040dfb86a9 [LibOS] Make parse_clone_flags() show exit signal name for clone() 2019-08-02 13:31:09 -07:00
Isaku Yamahata 1ce3d545aa [LibOS/vDSO] Add new rule to Makefile to verify vDSO has no relocations 2019-08-02 12:41:57 -07:00
Isaku Yamahata 514935d267 [LibOS/vDSO] Suppress relocation of vDSO symbols
Previously, relocation of vDSO symbols was not performed when vDSO
was mapped, leading to segfaults. The relocation of these symbols
is in fact not necessary, so this commit suppresses relocation by
using GOT entries with static symbols.
2019-08-02 12:41:57 -07:00
Isaku Yamahata 63f27e42d7 [LibOS] Remove abspath check from *at() syscalls
This patch is a follow-up of
https://github.com/oscarlab/graphene/pull/671. With #671, absolute path
check is handled uniformly by __path_lookupat(). Now absolute path check
in each system call isn't needed, so we can remove it.
2019-08-01 20:14:13 +02:00
Michał Kowalczyk 5ec5e2f24c Delete all reference monitor residues 2019-07-31 02:30:47 +02:00
Isaku Yamahata c7571408d6 [LibOS] Cleanup of shim_tls.h 2019-07-30 16:50:34 -07:00
Isaku Yamahata 5fe52e4a0d [LibOS] Use atomic operations for shim_context.preempt
enable_preempt(), disable_preempt(), and other functions operated on
shim_context.preempt using non-atomic operations. This commit replaces
the old broken implementation with atomic operations.
2019-07-30 16:50:34 -07:00
Chia-Che Tsai 0d89dda052 [LibOS] Fix the implementation of getrlimit/setrlimit syscalls
- Deprecate sys_stack_size and max_brk_size. Get the values directly from __rlim.cur.
- Add internal routines for setting and getting __rlim.cur.
- Implement prlimit64() and simplify getrlimit() and setrlimit().
2019-07-30 15:14:11 +02:00
Isaku Yamahata 50252c87e2 [LibOS] Replace incorrect "&&" with "&" in fs/str/fs.c 2019-07-29 18:58:05 -07:00
Dmitrii Kuvaiskii 4b734addcd [LibOS] Turn on CPSTORE_DERANDOMIZATION to fix intermittent bugs on fork
Previously, a checkpoint on child's do_migration() was allocated at a
random address and could overlap with parent's VMAs, leading to
intermittent bugs on some apps (including Apache under SGX PAL). This
commit turns on CPSTORE_DERANDOMIZATION so that the child always maps
the checkpoint at the same address as the parent. Note that this is
a temporary solution because of memory fragmentation and security
issues. It also disallows the parent process to have less memory than
the child (relevant in SGX environment, e.g., to GCC regression test).
2019-07-29 16:56:17 -07:00
Wojtek Porczyk 01f3553a25 [LibOS, Pal] Reorganize unit tests
- Deduplicate much of setup code.
- Allow running non-sandbox and sandbox code in single run.
- Use pytest.
- Generate JUnit-XML file for Jenkins.
- Document running a subset of regression tests.
2019-07-29 19:38:14 +02:00
Martin Schmatz 38bd8ba208 [LibOS] Fix handle leak in epoll_ctl 2019-07-27 19:28:01 -07:00
Dmitrii Kuvaiskii bd46625395 [Regression] Update LTP tests to the upstream version
LTP test kill12 was removed from the PASSED list because it incorrectly
works unders Glibc 2.19. This improves stability of our LTP regression.
2019-07-27 18:40:29 -07:00
Chia-Che Tsai c295e5cd1d [LibOS] Do not wake up thread if arriving signal is ignored
When appending an arriving signal, LibOS must skip interrupting
the thread if the thread's signal handler is set to SIG_IGN.
2019-07-27 18:39:45 -07:00
Alex Merritt fdc206d339 [LibOS] Assert that context != NULL in shim_signal.c: illegal_upcall() 2019-07-26 13:35:11 -07:00
Chia-Che Tsai 9362b1317d [Jenkins] Tune the run time of LMBench 2019-07-25 18:17:35 -07:00
Chia-Che Tsai 8b1ae05125 [Jenkins] Tune the run time of Apache and Lighttpd tests 2019-07-24 19:46:04 -07:00
Isaku Yamahata a45f3b8196 [LibOS] Implement newfstatat() system call 2019-07-24 14:58:13 -07:00
borysp 48156fc17f [LibOS] Add regression test for reading large directory 2019-07-24 12:36:14 -07:00
borysp 7bfb250878 [LibOS] Enable readdir to list directories with many entries
chroot_readdir() tried to allocate a buffer big enough to hold all
entries, by calling DkStreamRead until it succeeded (increasing buffer
size otherwise). However, DkStreamRead could return partial results,
which was never handled (partial result means here it could return
just some objects, not a part of individual object). This commit fixes
this issue and refactors this function.
2019-07-24 12:27:54 -07:00
Chia-Che Tsai aa9743dbce [Regression] Update LTP tests to the upstream version 2019-07-23 18:31:37 -07:00
Michał Kowalczyk 52786e5f4d Fix a bunch of typos 2019-07-23 15:03:52 -07:00
Isaku Yamahata f0753437f5 [LibOS/Pal] Convert remaining python2 scripts to python3 2019-07-23 12:13:21 -07:00
Isaku Yamahata 12e9eb0c63 [LibOS] Omit field thread.dummy if ALIAS_VFORK_AS_FORK is defined 2019-07-23 01:03:51 -07:00
Isaku Yamahata 22bc3c2f49 [LibOS] Remove abused goto in shim_init() 2019-07-20 14:35:24 -07:00