Open Peng-Hu opened 2 years ago
When the malloc_zone of eapp is 80MB, the keystone driver allocates about 100MB of CMA for the entire epm through dma_alloc_coherent(). But when LOADELF() loads eapp and creates a page table for its malloc_zone, the system crashes when it reaches about 40MB. crash log is : enclabe-host: unhandled signal 11 code 0x1 at 0x0000000000000000 in libc-2.29.so
When I remove the debug print(), I can build the page table for the malloc_zone of size 60MB. But when I increase the size of malloc_zone to 64MB, the system crashes. I even wonder if the pages allocated by dma_alloc_coherent() have a time limit.
https://github.com/keystone-enclave/keystone-sdk/blob/7c80d656bcc236713c720980452c99cba63f9264/src/host/Enclave.cpp#L44
These 15 pages are all used for the last level page table and can only accommodate just 30MB enclave/runtime. There is an error in comment. Especially when the malloc_zone of eapp is increased to tens of MB, LoadELF will trigger out-of-bounds access (signal 11 sigsegv error).