Commit Graph
221 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
Michał Kowalczyk 09907126ed [LibOS] test/apps: Fix up apache and lighttpd tests 2019-08-16 02:33:34 +02: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
Dmitrii Kuvaiskii 61882a1c4c [LTP] Update submodule to reference improved-timeout asyncio02 2019-08-14 17:54:32 -07:00
Simon Gaiser 64e46adcc0 [Makefile] Use generated header dependencies
Fixes #189.
2019-08-14 00:44:17 +02: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
Michał Kowalczyk 5ec5e2f24c Delete all reference monitor residues 2019-07-31 02:30:47 +02: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
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 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
borysp 48156fc17f [LibOS] Add regression test for reading large directory 2019-07-24 12:36:14 -07:00
Chia-Che Tsai aa9743dbce [Regression] Update LTP tests to the upstream version 2019-07-23 18:31:37 -07:00
Isaku Yamahata f0753437f5 [LibOS/Pal] Convert remaining python2 scripts to python3 2019-07-23 12:13:21 -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
Dmitrii Kuvaiskii b0619cb7a6 [LibOS] Rework of IPC subsystem's creation of processes
Previously, Graphene incorrectly treated execve() under SGX PAL:
Graphene would emulate execve() as fork + execve, and the new forked
process didn't try to "assume" the identity of its parent (which
violated execve specification "all process attributes are preserved").

This commit reworks the implementations of clone/fork and execve. In
particular, the IPC subsystem clearly distinguishes between the two
cases: clone/fork works as before whereas execve forks new "real"
process (which starts executing the requested program) and silently
exits the now-useless "temporary" process. New "real" process assumes
the identity of "temporary" process by inheriting its VMID (ID of
process for IPC purposes) and IPC-info objects with their PAL handles.

This commit also cleans up initialization of four IPC-info objects: self
(creates process-unique server pipe for IPC), parent (holds pipe for IPC
with parent process), and two namespace leaders (hold pipes for IPC with
leader processes). To correctly identify new-process server pipe, the
implementation of create_pipe() now allows to create VMID-based pipe URI.
2019-07-19 01:03:41 -07:00
Dmitrii Kuvaiskii 0b244f67df [LibOS] Add core-dump info on default signal dispositions
This commit adds default signal dispositions (as per Linux) to all 32
standard signals. It also adds WCOREDUMP bit to correctly inform wait4()
status word.

This commit updates graphene-tests submodules to enable new killXX LTP
regression tests, as well as fix the waitpid05 LTP test. It is important
to update this submodule reference in this commit because otherwise
waitpid05 tests will fail Graphene's CI.
2019-07-19 01:03:41 -07:00
Dmitrii Kuvaiskii 601f17724a [Jenkins-SGX] Increase timeout on LibOS tests to 15 minutes
Also increases timeout on LibOS's "udp" test to 50 seconds. It seems to
timeout frequently otherwise.
2019-07-19 01:03:41 -07:00
Chia-Che Tsai a0803a22b4 [LibOS] Add a regression test for fstat() on a directory 2019-07-16 22:22:25 +02:00
Dmitrii Kuvaiskii dab4c96853 [LibOS] Add special handling in open() syscall (EISDIR, O_TRUNC)
- Add error case: fail with EISDIR if directory is open()'ed with
  writable access.
- Add additional checks: O_TRUNC must work only on regular writable
  files (otherwise do not truncate).

The commit also improves LibOS regression test on FS corner cases and
fixes a tiny bug in DkStreamSetLength() with assert hanging Graphene.
2019-07-03 16:08:25 -07:00
Dmitrii Kuvaiskii 7327aa62ab [LibOS] Fix bug of long relative paths (more than 256B)
Previously, Graphene had a bug when dentry's rel_path was not initialized
to actual relative path if parent + filename length was longer than
256B. The problem was that rel_path was a shim_qstr which could contain
maximum 256 chars. This commit increases the limit to 4096B and adds
checks to fail explicitly if rel_path is still too large. Also, it adds
LibOS regression test.

Note that relative paths greater than 256 chars in length are not
uncommon. Most OSes impose the limit of 4096 chars or no limit at all.
2019-07-03 16:08:25 -07:00
Chia-Che Tsai 728d16aca6 [LibOS] Fix C++ tests support
This commit:
* Fixes compilation and execution errors for C++ programs in LibOS/shim/test/native.
* Adds a C++ regression test.
2019-07-01 14:42:32 +02:00
Dmitrii Kuvaiskii 84ec50a2aa [LibOS/regression] Add OpenMP simple for-loop test
Previously, OpenMP apps failed to run under Graphene-SGX because it did
not support raw system calls (used inside of OpenMP lib, in particular
the futex() syscall). Since recently, Graphene-SGX has support for raw
syscall execution. This commit adds a test showing that OpenMP works.
2019-06-30 23:37:21 +02:00
Isaku Yamahata bdb8b9c36b [LibOS/regression] Add test for syscall instruction redirection
Add LibOS regression test which contains a raw syscall instruction to test
SIGILL handler hook logic (if SIGILL'ed instruction is a syscall, it is
redirected inside LibOS as if syscalldb() was called).
2019-06-18 16:41:41 -07:00
Dmitrii Kuvaiskii 04e592a1ab [Tests] Update ref to submodule graphene-tests with LTP-enabled set{get}groups() 2019-06-17 12:23:08 -07:00
Isaku Yamahata 8c058edfdf [LibOS] Remove warnings in building exec_invalid_args.c 2019-06-14 12:10:41 -07:00
Dmitrii Kuvaiskii b871a962dd [LibOS] Take into account adjacent VMAs on correct-memory check
Previously the check on correct memory region under Linux-SGX
(called is_in_one_vma()) only checked that the whole memory region fits
into one VMA. In some cases (e.g. DATA and BSS sections), memory regions
can span several adjacent VMAs. This commit refines the check and
renames it to is_in_adjacent_vmas(). It also adds a LibOS test.
2019-06-13 12:06:25 -07:00
Don Porter 7262d6000e Remove the apps directory from the repo
Replace with a submodule to include all of the test applications.
2019-06-11 20:31:06 -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 3bd067a13b [LibOS/regression] Add test for Unix domain sockets
This commit moves and modifies unix.c test from native/
to regression tests. This tests Unix domain sockets.
2019-05-29 16:11:27 -07:00
Isaku Yamahata c4bcf4ae8c [LibOS] Add logic for SS_DISABLE and SS_ONSTACK in sigaltstack()
This commit also adds LibOS regression test for sigaltstack(). This
test is currently disabled (signal delivery on sigaltstack is not yet
implemented).
2019-05-23 16:25:06 -07:00
Michał Kowalczyk 16d90cfe12 Fix parenthesizing and formatting of C macros 2019-05-23 19:14:23 +02:00
Isaku Yamahata 086b997792 [LibOS] Implement mincore() system call 2019-05-22 03:12:33 +02:00
Don Porter 5519bd1e2d [LibOS/test/apps] Delete deprecated tarballs (apache and gcc) 2019-05-21 00:07:47 -07:00
Isaku Yamahata b3ddad0c37 Remove warnings triggered on newer GCC (7.4.0) 2019-05-20 20:53:06 +02:00
Isaku Yamahata 5aa1483079 [LibOS/tests/ltp] Add getrlimit{01,02} to passing LTP tests
Also add missing EFAULT error handling in getrlimit().
2019-05-16 17:29:31 -07:00
Dmitrii Kuvaiskii 880d70a259 [LibOS] Return EFAULT on null file in execve()
Previously, execve(NULL, ...) failed with segfault. This commit adds
memory checks that all arguments of execve() are valid memory regions.
Also adds LibOS regression test on execve(bad-file, bad-args, bad-env).
2019-05-14 19:27:15 -07:00
Dmitrii Kuvaiskii e307eca021 [LibOS] Support of test_user_{memory/string} in SGX PAL
Previously, test_user_{memory/string} failed on Linux-SGX PAL.
These functions check if user-supplied buffer/string is accessible
inside LibOS. There was only one option: setup a segfault handler
to catch memory errors and access one byte of each page in user-supplied
buffer/string. If some byte is inaccessible, then exception is raised
and caught by segfault handler. The handler checks the faulting
address and redirects back to function and it returns with failure.

This option doesn't work under SGX because there is no trusted field
that contains the faulting address. SGX v1 doesn't have such field at
all, SGX v2 introduces a field in SSA.MISC region but only at the
4K-page granularity.

This commit adds a second option used for SGX PAL: functions consult
LibOS's internal VMA bookkeeping. If buffer/string is not in any VMA,
then these functions fail. This option is slightly slower than first one
since it requires locking and traversing a list of VMAs.
2019-05-14 00:23:35 -07:00
Isaku Yamahata a84fe47843 Clean up .gitignore files
Move generic patterns to the top-level .gitignore and add some more
patterns for convenience.
2019-05-14 03:03:49 +02:00
Rafał Wojdyła aba21c360e [LibOS] Return proper error code on initialization fail 2019-05-14 00:12:15 +02:00
Biao Lu 2c87e294fc [LibOS] Make /proc/cpuinfo output exactly like in Linux kernel
Some Linux applications get the number of CPU cores by querying
/proc/cpuinfo.  Before, such apps would be confused by a wrong
format of /proc/cpuinfo in Graphene. This commit updates format
to exactly the same as in Linux kernel.

This commit also adds a LibOS regression test for /proc/cpuinfo.
2019-05-07 18:59:37 -07:00
Michał Kowalczyk 2bc2c04194 Remove trailing blanks 2019-05-07 16:32:16 +02:00
Dmitrii Kuvaiskii 402020f8da [LibOS/regression] Add futex-timeout test
Before PR #554, futex() syscall incorrectly failed
if user-supplied timeout expired (also see PR #438).
This patch adds test on futex() with timeout.
2019-05-06 13:46:26 -07:00
Isaku Yamahata 0a8f97af5a [Pal/{Linux, Linux-SGX}] Add NULL check in udp_connect/sgx_ocall_sock_connect
This patch also adds a UDP LibOS regression test.
2019-05-03 12:50:03 -07:00
Don Porter e62a021fd8 Add an open method to /proc and some subdirectories
This addresses issue #461.
2019-05-01 09:04:51 -04:00