Commit Graph
854 Commits
Author SHA1 Message Date
Chia-Che Tsai 036ad25686 fixup! [PAL] Fix unaligned memory adresses and sizes 2019-08-20 15:44:57 -05:00
Chia-Che Tsai 180f21e63b [PAL] Fix unaligned memory adresses and sizes 2019-08-20 15:38:45 -05:00
Chia-Che Tsai 31777959e2 [SGX/Linux PAL] Assert if _DkVirtualMemoryAlloc(), _DkVirtualMemoryFree(), _DkVirtualMemoryProtect() get unaligned addresses or sizes 2019-08-20 03:08:11 -05:00
Don Porter 60bed726e3 [PAL] Fix cpuid parsing on a system with hyperthreads 2019-08-19 16:13:42 -04:00
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 215c00ab0c [Pal/Linux-SGX] Makefile cleanup 2019-08-16 16:58:57 -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
Li Lei 030a088892 [Tools] Multiple bug fixes of Graphene Secure Container (GSC) tool
- Forward container's LD_LIBRARY_PATH to the generated manifest
- Handle special library names when generating trusted files (libxxx-xxx.so)
- Add more standard files/directories to the generated manifest
2019-08-15 18:12:31 -07:00
Don Porter e4793d6886 [Jenkins] Make sure the right kernel version is installed 2019-08-16 00:25:53 +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 26fb253b58 Makefile.rules: Add new rule to build executable from single .c/.cpp 2019-08-15 14:30:57 +02:00
Isaku Yamahata 009e4fdded Makefile.config: Add default CXX definition 2019-08-15 13:55:11 +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
Simon Gaiser f8b60ced5c [Jenkins] Don't update LTP submodule twice
Jenkins already runs a recursive submodule update. So no need to do this
again manually.
2019-08-14 13:08:55 -07:00
Don Porter d1ea2dae12 [README] Add documentation about required packages 2019-08-13 20:57:09 -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
borysp cbac2b5b50 [Pal] Fix typos 2019-08-13 16:18:35 +02:00
borysp d4ac504842 [Pal] Enable relative manifest path 2019-08-12 20:22:27 -07:00
borysp 8fc5d60777 [Pal/regression] Add path normalization tests 2019-08-12 20:22:27 -07:00
borysp 7df0739e9a [Pal] Fix bugs in path normalization
Previous implementation had a few bugs in path-normalization functions,
e.g., in get_norm_path(): "../..a/" -> "....a" and "/../a"   -> "../a",
and in get_base_name(): "/" -> garbage (buffer overflow).
2019-08-12 20:21:19 -07: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
Simon Gaiser 8c37290b6f [Jenkins] Use shell comment in Jenkins shell script
Fixes commit bdb5874 "[Jenkins] Test the build of graphene-ipc module"
2019-08-08 12:56:07 -07:00
Simon Gaiser 6eec7d7c48 [Makefile] Don't depend on locale settings when parsing readelf 2019-08-07 19:38:04 -07:00
Chia-Che Tsai 914c6d8c86 [Pal/Makefiles] Force -no-pie when building PAL tests
PAL loader cannot relocate executables. Thus, PIE executables (per
default GCC setting on Ubuntu 18.04) will crash if no other loader
(e.g., Glibc loader) is involved. Since PAL tests are only for
internal testing purposes, we simply make these tests position-
dependent (adding -no-pie to CFLAGS).
2019-08-07 17:54:45 -07:00
Isaku Yamahata 77904ffeb0 [Pal/Linux-SGX] Fix incorrect "0x%p" format string for ocall_load_debug()
Previously, setup_pal_map() instructed GDB to load symbols for the PAL
shared library using incorrectly formatted string with "0x%p". This led
to addresses of the form "0x0xdeadbeef" which could not be parsed by
GDB. This commit fixes this via "%p" and thus enables SGX-GDB again.
2019-08-07 16:22:00 -07:00
Isaku Yamahata 161ea54354 [pal_loader] Introduce INSIDE_EMACS arg to pal_loader so it runs GDB under Emacs 2019-08-05 12:22:27 -07:00
Isaku Yamahata f53c3afd95 [Pal/Linux-SGX] Fix undef behavior by initializing opt with const in get_sockopt() 2019-08-02 17:35:13 -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
Martin Schmatz b6d327edac [Pal/Linux-SGX] Initialize socket options to zero and reuseaddr to 1
This commit fixes uninitialized variable sock_options in tcp_connect(),
tcp_listen(), tcp_accept(), udp_bind(), and udp_connect().
2019-08-02 03:28:45 -07:00