[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <162377378414.19906.6678244614782222506.tip-bot2@tip-bot2>
Date: Tue, 15 Jun 2021 16:16:24 -0000
From: "tip-bot2 for Kai Huang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Kai Huang <kai.huang@...el.com>, Borislav Petkov <bp@...e.de>,
Dave Hansen <dave.hansen@...el.com>,
Yang Zhong <yang.zhong@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/urgent] x86/sgx: Add missing xa_destroy() when virtual EPC
is destroyed
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 4692bc775d2180a937335ccba0edce557103d44a
Gitweb: https://git.kernel.org/tip/4692bc775d2180a937335ccba0edce557103d44a
Author: Kai Huang <kai.huang@...el.com>
AuthorDate: Tue, 15 Jun 2021 22:16:39 +12:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Tue, 15 Jun 2021 18:03:45 +02:00
x86/sgx: Add missing xa_destroy() when virtual EPC is destroyed
xa_destroy() needs to be called to destroy a virtual EPC's page array
before calling kfree() to free the virtual EPC. Currently it is not
called so add the missing xa_destroy().
Fixes: 540745ddbc70 ("x86/sgx: Introduce virtual EPC for use by KVM guests")
Signed-off-by: Kai Huang <kai.huang@...el.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Acked-by: Dave Hansen <dave.hansen@...el.com>
Tested-by: Yang Zhong <yang.zhong@...el.com>
Link: https://lkml.kernel.org/r/20210615101639.291929-1-kai.huang@intel.com
---
arch/x86/kernel/cpu/sgx/virt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c
index 6ad165a..64511c4 100644
--- a/arch/x86/kernel/cpu/sgx/virt.c
+++ b/arch/x86/kernel/cpu/sgx/virt.c
@@ -212,6 +212,7 @@ static int sgx_vepc_release(struct inode *inode, struct file *file)
list_splice_tail(&secs_pages, &zombie_secs_pages);
mutex_unlock(&zombie_secs_pages_lock);
+ xa_destroy(&vepc->page_array);
kfree(vepc);
return 0;
Powered by blists - more mailing lists