Skip to content
Snippets Groups Projects
Commit cbe6c152 authored by Miaohe Lin's avatar Miaohe Lin Committed by Yang Yingliang
Browse files

KVM: SVM: Fix potential memory leak in svm_cpu_init()


mainline inclusion
from mainline-v5.6-rc4
commit d80b64ff
category: bugfix
bugzilla: 13690
CVE: CVE-2020-12768

-------------------------------------------------

When kmalloc memory for sd->sev_vmcbs failed, we forget to free the page
held by sd->save_area. Also get rid of the var r as '-ENOMEM' is actually
the only possible outcome here.

Reviewed-by: default avatarLiran Alon <liran.alon@oracle.com>
Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 0a00673b
No related branches found
No related tags found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment