On Thu, Aug 08, 2019 at 06:34:59PM +0300, Jarkko Sakkinen wrote: > On Wed, Aug 07, 2019 at 05:12:44PM -0700, Sean Christopherson wrote: > > Detect the SECS in paging related flows by explicitly checking the page > > against the enclave's SECS page. Assuming a page with VA=0 is the SECS > > will break enclaves that actually use VA=0, which is extremely unlikely > > but theoretically possible. > > > > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> > > I would define a macro to the same place where SGX_ENCL_PAGE_ADDR() is > defined and also SGX_ENCL_PAGE_IS_SECS() would definitely more > self-describing name. > > Can't you BTW just use the backpointer in struct sgx_encl_page to the > enclave since we have it there? It is even set for SECS in > sgx_encl_create(). Yeah, that would work too. I passed in @encl to match the format of sgx_encl_get_index(), perhaps it makes sense to use the backpointer there as well?