On Fri, Oct 18, 2019 at 12:57:13PM +0300, Jarkko Sakkinen wrote: > On Wed, Oct 16, 2019 at 11:37:34AM -0700, Sean Christopherson wrote: > > Use the kernel's virtual address to reference the source page when > > EADDing a page to the enclave. gup() "does not guarantee that the page > > exists in the user mappings", i.e. EADD can still fault and deadlock > > due to mmap_sem contention if it consumes the userspace address. > > > > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> > > + kunmap_atomic((void *)pginfo.contents); > > Remark: if not casted first to unsigned long, it will give a warning on > 32-bit build. Do we care? SGX is 64-bit only, I don't see that changing anytime soon.