summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/sgx/ioctl.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko@kernel.org>2020-11-18 23:39:32 +0200
committerBorislav Petkov <bp@suse.de>2020-11-19 10:51:24 +0100
commit14132a5b807bb5caf778fe7ae1597e630971e949 (patch)
tree3018b699e0601055b6187b1b066729261c1a08b5 /arch/x86/kernel/cpu/sgx/ioctl.c
parent0eaa8d153a1d573e53b8283c90db44057d1376f6 (diff)
downloadlinux-stable-14132a5b807bb5caf778fe7ae1597e630971e949.tar.gz
linux-stable-14132a5b807bb5caf778fe7ae1597e630971e949.tar.bz2
linux-stable-14132a5b807bb5caf778fe7ae1597e630971e949.zip
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 <haitao.huang@intel.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20201118213932.63341-1-jarkko@kernel.org
Diffstat (limited to 'arch/x86/kernel/cpu/sgx/ioctl.c')
-rw-r--r--arch/x86/kernel/cpu/sgx/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index 6d37117ac8a0..30aefc93a31d 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -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;
}