On Wed, Oct 16, 2019 at 11:37:36AM -0700, Sean Christopherson wrote: > Rework EEXTEND error handling to fix issues related to destroying the > enclave in response to EEXTEND failure. At the time of EEXTEND, the > page is already visibile in the sense that it has been added to the > radix tree, and therefore will be processed by sgx_encl_destroy(). This > means the "add" part needs to be fully completed prior to invoking > sgx_encl_destroy() in order to avoid consuming half-baked state. > > Move sgx_encl_destroy() to the call site of __sgx_encl_extend() so that > it is somewhat more obvious why the add needs to complete before doing > EEXTEND. > > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> First three (1, 2, 3) have been applied. /Jarkko