lsds / sgx-lkl

SGX-LKL Library OS for running Linux applications inside of Intel SGX enclaves
MIT License
257 stars 89 forks source link

Specify the Maximum Heap Size in Enclave #852

Closed randoruf closed 2 years ago

randoruf commented 2 years ago

In the legacy sgx-lkl, it is easy to tell the runner how much space the application wants by passing SGXLKL_HEAP environment variable. But this option looks disappeared in SGX-LKL oe port. I have attempted to build openenclave with -DOE_HEAP_ALLOTTED_PAGE_COUNT=512000 and then pass SGXLKL_OE_HEAP_PAGE_COUNT= 512000, but the heap stress test here https://github.com/randoruf/cs-nano-projects/tree/main/sgx-lkl-oe-calloc-stress failed to generated the heap size I wanted.

Is there a method to tell sgx-lkl the size of the enclave in the initialization phase?

randoruf commented 2 years ago

for anyone who is interested in this issue: https://github.com/lsds/sgx-lkl/blob/oe_port/samples/languages/nodejs/nodejs-enclave_config.json