16 Commits
Author SHA1 Message Date
Stefan Berger 183ca70fd4 [Pal] Make File regression test work with PAGE_SIZE != 4096 2021-01-25 23:20:45 -08:00
Stefan Berger 2191381327 [PAL] regression/File: Fix a buffer overflow
buffer[ret = 40] overflows the buffer of size 40. It's not necessary to
NULL terminate this buffer, so just remove the offending statements.
2021-01-16 01:27:43 +01:00
Dmitrii Kuvaiskii 3bcab01a0c [Pal/Linux-SGX] Remove "sgx.allow_file_creation" and always allow it
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.
2020-10-06 00:20:22 -07:00
Michał Kowalczyk ad477ec7bf Reformat repository to our C formatting rules (final iteration) 2020-09-15 02:00:54 +02:00
Stefan Berger 14db27c34a [Pal] Define PAGE_SIZE in pal-arch.h and use in regression test
Define the typically used PAGE_SIZE in pal-arch.h and use it in the
File.c regression test that maps memory of one page.
2020-05-12 18:31:35 +02:00
Dmitrii Kuvaiskii 301587065a [LibOS,Pal] Make Graphene build with GCC 9.3
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).
2020-05-01 23:15:30 +00:00
Michał Kowalczyk e39ee4767f Convert flags between PAL API and host syscalls
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.
2020-04-27 19:54:55 +02:00
Jia Zhang 3fd22f2c8e [Pal/regression] Add regression test for sgx.allow_file_creation 2019-11-08 11:58:50 -08:00
Michał Kowalczyk de42ebabe1 Reformat repository to our clang-format rules 2019-09-09 22:11:23 +02:00
Chia-Che Tsai be9852784f [All components] Remove all modelines from all source files 2019-06-07 15:30:43 -05: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
Li Lei 195c2b1f7b [PAL] Enable Wunsed-parameter warning as part of Wextra 2019-04-03 14:27:43 +02: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
Chia-Che Tsai cb687eabb2 minor bugfixes in regression tests 2015-05-20 16:11:27 -04:00
Chia-Che Tsai 7f19f62f31 beta version 0.2
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.
2015-05-20 14:15:52 -04:00