x86/sgx: Return -ERESTARTSYS in sgx_ioc_enclave_add_pages()
Jarkko Sakkinen
maintainerPATCH 1/1 x86/sgx: Return -ERESTARTSYS in sgx_ioc_enclave_add_pages()
Return -ERESTARTSYS instead of -EINTR in sgx_ioc_enclave_add_pages() when interrupted before any pages have been processed. At this point ioctl can be obviously safely restarted.
Reported-by Haitao Huang <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Borislav Petkov <[email protected]>
Signed-off-by Jarkko Sakkinen <[email protected]>
--- arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/sgx/ioctl.c +1 -1
@@ -444,7 +444,7 @@ static long sgx_ioc_enclave_add_pages(struct sgx_encl *encl, void __user *arg)for (c =0 ; c < add_arg.length; c +=PAGE_SIZE ) {if (signal_pending (current)) {if (!c) - ret = -EINTR ; + ret = -ERESTARTSYS ;break ; }
Signature · 1 line
2.27.0