Commit Graph
78 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
Simon Gaiser 64e46adcc0 [Makefile] Use generated header dependencies
Fixes #189.
2019-08-14 00:44:17 +02:00
borysp 8fc5d60777 [Pal/regression] Add path normalization tests 2019-08-12 20:22:27 -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
Michał Kowalczyk 5ec5e2f24c Delete all reference monitor residues 2019-07-31 02:30:47 +02:00
Dmitrii Kuvaiskii d34726f0af [Jenkins/Pal] Fix test_000_symbols test on debug SGX pipepine
Previously, test_000_symbols PAL regression test compared all lines in
stderr against a list of expected values (prefixed with "Dk...").
However, SGX PAL in debug mode outputs additional SGX-related
information in stderr which broke the test. This commit fixes this by
checking only lines which start with "Dk...".
2019-07-30 13:47:45 -07:00
Wojtek Porczyk fecd4969ad [Pal] Temporary skip broken unittest for missing executable
This is workaround for #860, because test result has to be clean to
merge #833.
2019-07-29 19:40:00 +02: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
Don Porter 27ca6f0700 [Jenkins] Set up 18.04 CI jobs, fix one unit PAL unit test 2019-07-19 13:39:12 -04:00
Isaku Yamahata 7eade65b91 [Pal, LibOS] Fix vprintf signature to take va_list instead of its pointer 2019-07-09 12:34:50 -07:00
Don Porter a0c208f71e [Makefiles] Enable parallel make in Jenkins, fix parallel make for SGX 2019-06-20 19:16:10 -07:00
Chia-Che Tsai be9852784f [All components] Remove all modelines from all source files 2019-06-07 15:30:43 -05:00
Isaku Yamahata 8e894b10d0 [Pal/Linux-SGX] pal-sgx-sign: add enable_avx option and drop disable_avx option
For consistency, add enable_avx option in addition to enable_avx512 and
drop disable_avx option. Because this is incompatible change, update
affected manifest.template file.

Attribute tracking logic is changed to use set because list may cause
ValueError.
2019-05-30 13:55:45 +02:00
Michał Kowalczyk 16d90cfe12 Fix parenthesizing and formatting of C macros 2019-05-23 19:14:23 +02:00
Michał Kowalczyk 46f553fe5d Cleanup and uppercase C macros 2019-05-23 19:14:23 +02:00
Michał Kowalczyk 2bc2c04194 Remove trailing blanks 2019-05-07 16:32:16 +02:00
Michał Kowalczyk 281a05ce48 Fix camel case in DkStreamAttributes{Query,Set}ByHandle 2019-05-06 18:11:15 -07:00
Isaku Yamahata 8dd311a353 [Pal/Linux-SGX] Add format check to pal_printf
Add __attribute__((format(printf))) check to pal_printf and
fix corresponding format errors.
2019-05-01 15:50:12 -07:00
Michał Kowalczyk 382a1ec394 Cleanup .gitignore files 2019-04-30 23:16:38 +02:00
Michał Kowalczyk 17102eab9d Change DkRandomBitsRead interface and fix error checking
Now it returns 0 on success and -PAL_* on error.
2019-04-30 22:26:08 +02:00
Dmitrii Kuvaiskii bd72b968ee [*/regression] Increase timeout of regression tests
On weaker machines (Intel NUCs and SGX-enabled laptops),
SGX regression tests take longer than 5 seconds because
Graphene measures/zeroes all enclave memory at startup.
Increase the timeout for SGX regression tests to 20 sec.
2019-04-29 18:10:32 -07:00
Simon Gaiser 63b8ef41cf [Pal/regression] Test timeout handling when waiting for events 2019-04-30 01:11:31 +02:00
Simon Gaiser ab29483bbe [Pal/regression] Increase 'Process' test timeout a bit
On SGX spawning processes got slower since we measure/zero all memory.
So the timeout is slightly missed.
2019-04-29 21:31:59 +02:00
Simon Gaiser 2b8c4fc30b [Pal/regression] Add test for red zone 2019-04-29 00:04:22 +02:00
Simon Gaiser 87b139019a [Pal/regression] Test thread cleanup
This adds a test for thread cleanup. It tests two things:

 1. Thred exit in general works, both through return as well as
    DkThreadExit.

 2. If there's a thread limit, like on SGX, it tests that after a thread
    has finished it no longer counts against the limit (currently
    broken, see issue #517).
2019-04-26 18:24:26 +02:00
Simon Gaiser f30f7e7575 [*/regression] Use uniform and cleaner SGX environment check
As suggested by @yamahata in PR #612.
2019-04-17 02:08:37 +02:00
Simon Gaiser 4f4ec22070 [Pal/regression] Drop unused variable in 00_Atomics.py 2019-04-17 02:07:43 +02:00
Simon Gaiser 0a0babc26a [*/regression] Remove trailing whitespace in Python files 2019-04-15 17:27:30 +02:00
Simon Gaiser 79d6fb27ec [*/regression] Migrate to Python 3 2019-04-15 17:27:30 +02:00
Simon Gaiser 3d60004a8c [*/regression] Drop unused shebang
The regression python scripts are not marked executable. Also they
expect that the Makefile has setup the environment correctly so just
marking them executable would not be useful. So drop the unused shebang
to avoid encoding the interpreter in multiple places.

Script/regression.py is a library so it also doesn't need a shebang.
2019-04-15 17:24:27 +02:00
Li Lei 195c2b1f7b [PAL] Enable Wunsed-parameter warning as part of Wextra 2019-04-03 14:27:43 +02:00
Don Porter 3f316254b0 Drop the monitor regression test 2019-04-02 14:55:15 -04:00
Don Porter 1286dec7ab Ensure unit tests actually return a failure message 2019-04-02 14:55:15 -04:00
Simon Gaiser 0bc6b460b8 [Pal/regression] Handle unopened broadcast stream
If the broadcast stream is not opened this most likely means that
there's no configured multicast route so add a helpful warning. Also no
point in trying to read/write from/to a non-existent stream.

Resolves #501.
2019-03-18 20:35:05 +01:00
Simon Gaiser 9d1b70bd57 [Scripts/regression] Rename 'flaky' to 'ignore_failure'
There are different reasons why a test failure should be ignored, so
rename the option to avoid confusion if the test isn't flaky.
2019-03-18 17:03:15 +01:00
Simon Gaiser 7948e2eae8 [Pal/regression] Document why memory permission/dealloc test fail on SGX 2019-03-18 16:12:01 +01:00
Michał Kowalczyk 8346868dfc [PAL] Rename PAL_EVENT_DIVZERO to PAL_EVENT_ARITHMETIC_ERROR 2019-03-14 00:39:23 +01:00
Chia-Che Tsai cba6e3278a Add -Werror to CFLAGS with WERROR=1
Signed-off-by: Chia-Che Tsai <chiache@tamu.edu>
2019-02-12 20:09:43 -06:00
Chia-Che Tsai 48f330c88b [Linux/SGX PAL] Use the C11 standard instead of GNU99
Signed-off-by: Chia-Che Tsai <chiache@tamu.edu>
2019-02-10 13:52:18 -06:00
Michał Kowalczyk 91f1301bd3 Fix Python shebangs compatibility 2019-02-05 17:59:25 +01:00
Li Lei 405116dbf3 Add a manifest option sgx.disable_avx to support running graphene-sgx on the platform which doesn't have avx feature 2019-01-28 14:57:15 -05:00
Don Porter 5d8c9ac260 Fix error code propagation on SGX (#205), add unit tests for exit code propagation 2018-12-04 20:43:05 -05:00
Don Porter 4ebad2401e PAL should give a clearer error when the executable cannot be found. Add it, and make a unit test for this behavior.
Fix loading by manifest on the SGX PAL, and fix the unit test that should be testing this.
2018-11-29 12:55:56 -08:00
Don Porter 203a3920fa Fix a regression on exec in trying to repro #59. Remove an assertion that doesn't seem to be doing much good, given that the size is always statically determined in hex2str.
Fixing the bound of a debug buffer in SGX PAL

Rewrite bytes2hexstr; Add two new macros, alloca_bytes2hexstr() and malloc_bytes2hexstr().

Remove HASHBUF_SIZE

Add comments for the bytes2hexstr() macros.

Add a compile-time assertion
2018-11-13 13:02:42 -05:00
Chia-Che Tsai 7f5a4cc87f Allowing concurrent builds of different PALs 2018-10-29 17:23:51 -04:00
Chia-Che Tsai a92f2c4973 Simplifying the flaky memory availability test for PAL 2018-10-25 08:32:28 -04:00
Jat 6a1faf7874 gcc -dumpmachine returns x86_64-xxx-linux-gnu (#242)
This change normalizes the behavior of the Makefile in checking for the host system time, building across a wider range of systems.
2018-10-10 11:35:30 -07:00
Chia-Che Tsai 00c4ed0253 Implement sched_getaffinity system call (#209)
* implement sched_getaffinity system call

* add sched_getaffinity1~8 to the passed list

* adding PAL regression test for CPU info
2018-06-26 09:53:28 -07:00
Don Porter 03cb0e0bb3 Address a TOCTTOU vulnerability in SGX read/map (#131)
* Fix a bug where configuration error ends up doing a huge allocation, rather than catching the error.  Add some documentation to the slabmgr code.

* Add a unit test and some documentation to answer the question in issue #107.  I can't see how offset and map_start would end up being different.

* Rewrite of SGX file_map to remove TOCTTTOU now passes all unit tests

* Apply a similar fix to file_read.  

* Factor complicated verification code into a common helper routine.

* Adjust the memory copying strategy so that all bits in the returned buffed are exactly the same bits as verified in the trusted, scratch buffer.

* Fixing the TOCTOU issue in file checking

* Adding comments for load_trusted_file() and copy_and_check_trusted_file(); Deprecate the old design

* Documenting the file checking mechanism
2018-06-25 07:54:40 -07:00
Don Porter 1f2360c857 Hex2str clean up and unit testing (#134)
* Fix off-by-one error in __hex2str()

* Add a unit test and documentation for hex2str, in light of issue #129/PR #130.  Although only used by SGX pal, I moved hex2str into a library function, since it isn't SGX specifix.  Change the function signature to pass in a stack-allocated buffer.  Adjust a few hash types, and make the build stop earlier on a failure.
2018-06-16 17:31:20 -04:00