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).
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...".
- 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.
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.
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.
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).
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.
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.
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
* 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
* 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.