Skip to content

Commit 4692bc7

Browse files
kaihuangsuryasaimadhu
authored andcommitted
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: 540745d ("x86/sgx: Introduce virtual EPC for use by KVM guests") Signed-off-by: Kai Huang <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Dave Hansen <[email protected]> Tested-by: Yang Zhong <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent efa1655 commit 4692bc7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kernel/cpu/sgx/virt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ static int sgx_vepc_release(struct inode *inode, struct file *file)
212212
list_splice_tail(&secs_pages, &zombie_secs_pages);
213213
mutex_unlock(&zombie_secs_pages_lock);
214214

215+
xa_destroy(&vepc->page_array);
215216
kfree(vepc);
216217

217218
return 0;

0 commit comments

Comments
 (0)