Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

An error in comment: 15 pages reserved for page tables are not sufficient to cover several hundreds of megabytes of enclave/runtime #83

Open
Peng-Hu opened this issue Mar 15, 2022 · 2 comments

Comments

@Peng-Hu
Copy link

Peng-Hu commented Mar 15, 2022

req_pages += 15;

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

@Peng-Hu Peng-Hu changed the title The 15 pages reserved for page tables are not sufficient to cover several hundreds of megabytes of enclave/runtime An error in comment: 15 pages reserved for page tables are not sufficient to cover several hundreds of megabytes of enclave/runtime Mar 15, 2022
@Peng-Hu
Copy link
Author

Peng-Hu commented Mar 15, 2022

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

@Peng-Hu
Copy link
Author

Peng-Hu commented Mar 15, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant