Re: [PATCH v20 00/28] Intel SGX1 support

From: Jethro Beekman
Date: Fri May 10 2019 - 15:05:57 EST

On 2019-05-10 11:56, Xing, Cedric wrote:
Hi Jethro,
ELF files are explicitly designed such that you can map them (with mmap)
in 4096-byte chunks. However, sometimes there's overlap and you will
sometimes see that a particular offset is mapped twice because the first
half of the page in the file belongs to an RX range and the second half
to an R-only range. Also, ELF files don't (normally) describe stack,
heap, etc. which you do need for enclaves.

You have probably misread my email. By mmap(), I meant the enclave file would be mapped via *multiple* mmap() calls, in the same way as what dlopen() would do in loading regular shared object. The intention here is to make the enclave file subject to the same checks as regular shared objects.

No, I didn't misread your email. My original point still stands: requiring that an enclave's memory is created from one or more mmap calls of a file puts significant restrictions on the enclave's on-disk representation.

Jethro Beekman | Fortanix

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature