The manifest option "sgx.allow_file_creation" is useless (most
real-world apps will set it to "1" anyway). So this commit simply
removes this option and always allows to create files.
GCC 9.3 adds more static checks on C headers and sources. This
commit fixes all detected issues (mainly possible NULL pointer
dereferences and VLAs on stack).
Currently various flags in file and memory syscalls work mostly by an
accident, because values of some of them align with corresponding Linux
syscall flags. Some APIs weren't that lucky though - e.g.
DkStreamOpen(..., /*options=*/PAL_OPTION_CLOEXEC) deletes file contents
(sic!) intead of opening it with O_CLOEXEC. This is because
PAL_OPTION_CLOEXEC == O_TRUNC.
This commit fixes all this mess and also adds asserts to check validity
of flags passed to Dk* handlers.
* 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
Plenty of bugfixes for Linux kernel later than 3.5 and Ubuntu later than 10.10.
More organized code to improve portability.
Regression tests for Pal to test completeness of implementation.