x86/sgx: Handle VA page allocation failure for EAUG on PF.
VM_FAULT_NOPAGE is expected behaviour for -EBUSY failure path, when
augmenting a page, as this means that the reclaimer thread has been
triggered, and the intention is just to round-trip in ring-3, and
retry with a new page fault.
Fixes: 5a90d2c3f5
("x86/sgx: Support adding of pages to an initialized enclave")
Signed-off-by: Haitao Huang <haitao.huang@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20220906000221.34286-3-jarkko@kernel.org
This commit is contained in:
parent
133e049a3f
commit
81fa6fd13b
@ -344,8 +344,11 @@ static vm_fault_t sgx_encl_eaug_page(struct vm_area_struct *vma,
|
||||
}
|
||||
|
||||
va_page = sgx_encl_grow(encl, false);
|
||||
if (IS_ERR(va_page))
|
||||
if (IS_ERR(va_page)) {
|
||||
if (PTR_ERR(va_page) == -EBUSY)
|
||||
vmret = VM_FAULT_NOPAGE;
|
||||
goto err_out_epc;
|
||||
}
|
||||
|
||||
if (va_page)
|
||||
list_add(&va_page->list, &encl->va_pages);
|
||||
|
Loading…
Reference in New Issue
Block a user