On Mon, Aug 26, 2019 at 05:11:28PM -0700, Sean Christopherson wrote: > Reverse the order in which encl->lock and mm->mmap_sem are taken during > ENCLAVE_ADD_PAGE so as to adhere to SGX's lock ordering requirements. > Attempting to acquire mm->mmap_sem while holding encl->lock can result > in deadlock. > > Refactor EEXTEND and the final bookkeeping out of __sgx_encl_add_page() > so that mm->mmap_sem can be dropped after EADD without spreading the > lock/unlock across multiple functions. > > Reported-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx> > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> Thanks, looks good. Acked-by: Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx> /Jarkko