keystone-enclave / keystone-sdk

SDK for Keystone Enclave - ABI/SBI libraries and sample apps
Other
44 stars 22 forks source link

A misaligned program section causes a wrong page allocation #19

Open dayeol opened 5 years ago

dayeol commented 5 years ago

I have made a wrong assumption that the starting VA of each program header is page-aligned, which is not true. This causes a wrong page allocation with a misaligned VA, making the enclave non-functional.

At this moment, temporary fix has been applied for iozone benchmark (#17), which just works for cases where the misaligned program header is contained in a non-overlapping page with the previous program header (e.g., phdr0 ends at page A and phdr1 starts at page B where A != B) This should be re-written such that the ELF loader identifies misaligned VAs and handle them correctly.