* Re: [PATCH][resend] KVM: fix error handling in svm_cpu_init
@ 2020-02-20 8:18 linmiaohe
2020-02-20 8:31 ` 答复: " Li,Rongqing
0 siblings, 1 reply; 7+ messages in thread
From: linmiaohe @ 2020-02-20 8:18 UTC (permalink / raw)
To: Li RongQing, pbonzini, vkuznets; +Cc: Liran Alon, kvm, linux-kernel, x86
Hi,
Li RongQing <lirongqing@baidu.com> writes:
>
>sd->save_area should be freed in error path
>
>Fixes: 70cd94e60c733 ("KVM: SVM: VMRUN should use associated ASID when SEV is enabled")
>Signed-off-by: Li RongQing <lirongqing@baidu.com>
>Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
>Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>---
> arch/x86/kvm/svm.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
Oh, it's strange. This is already fixed in my previous patch : [PATCH v2] KVM: SVM: Fix potential memory leak in svm_cpu_init().
And Vitaly and Liran gave me Reviewed-by tags and Paolo queued it one month ago. But I can't found it in master or queue
branch. There might be something wrong. :(
^ permalink raw reply [flat|nested] 7+ messages in thread
* 答复: [PATCH][resend] KVM: fix error handling in svm_cpu_init
2020-02-20 8:18 [PATCH][resend] KVM: fix error handling in svm_cpu_init linmiaohe
@ 2020-02-20 8:31 ` Li,Rongqing
0 siblings, 0 replies; 7+ messages in thread
From: Li,Rongqing @ 2020-02-20 8:31 UTC (permalink / raw)
To: linmiaohe, pbonzini, vkuznets; +Cc: Liran Alon, kvm, linux-kernel, x86
> -----邮件原件-----
> 发件人: linmiaohe [mailto:linmiaohe@huawei.com]
> 发送时间: 2020年2月20日 16:18
> 收件人: Li,Rongqing <lirongqing@baidu.com>; pbonzini@redhat.com;
> vkuznets@redhat.com
> 抄送: Liran Alon <liran.alon@oracle.com>; kvm@vger.kernel.org;
> linux-kernel@vger.kernel.org; x86@kernel.org
> 主题: Re: [PATCH][resend] KVM: fix error handling in svm_cpu_init
>
> Hi,
> Li RongQing <lirongqing@baidu.com> writes:
> >
> >sd->save_area should be freed in error path
> >
> >Fixes: 70cd94e60c733 ("KVM: SVM: VMRUN should use associated ASID when
> >SEV is enabled")
> >Signed-off-by: Li RongQing <lirongqing@baidu.com>
> >Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
> >Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> >---
> > arch/x86/kvm/svm.c | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
>
> Oh, it's strange. This is already fixed in my previous patch : [PATCH v2] KVM:
> SVM: Fix potential memory leak in svm_cpu_init().
> And Vitaly and Liran gave me Reviewed-by tags and Paolo queued it one month
> ago. But I can't found it in master or queue branch. There might be something
> wrong. :(
In fact, I send this patch 2019/02/, and get Reviewed-by, but did not queue
https://patchwork.kernel.org/patch/10853973/
and resend it 2019/07
https://patchwork.kernel.org/patch/11032081/
-Li
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][resend] KVM: fix error handling in svm_cpu_init
@ 2020-02-24 2:08 linmiaohe
0 siblings, 0 replies; 7+ messages in thread
From: linmiaohe @ 2020-02-24 2:08 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Li,Rongqing, Liran Alon, kvm, linux-kernel, x86, vkuznets
Paolo Bonzini <pbonzini@redhat.com> wrote:
>On 20/02/20 09:40, linmiaohe wrote:
>> Li,Rongqing <lirongqing@baidu.com> writes:
>>>> Hi,
>>>> Li RongQing <lirongqing@baidu.com> writes:
>>>>>
>>
>> Oh, it's really a pit. And in this case, we can get rid of the var r
>> as '-ENOMEM' is actually the only possible outcome here, as suggested
>> by Vitaly, which looks like this: https://lkml.org/lkml/2020/1/15/933
>
>I queued your patch again, sorry to both of you.
>
There are tons of patches every day. It's really hard to escape from forgetting someone. :)
Many thanks for your great work all the time!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][resend] KVM: fix error handling in svm_cpu_init
2020-02-20 8:40 linmiaohe
@ 2020-02-21 16:58 ` Paolo Bonzini
0 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2020-02-21 16:58 UTC (permalink / raw)
To: linmiaohe, Li,Rongqing; +Cc: Liran Alon, kvm, linux-kernel, x86, vkuznets
On 20/02/20 09:40, linmiaohe wrote:
> Li,Rongqing <lirongqing@baidu.com> writes:
>>> Hi,
>>> Li RongQing <lirongqing@baidu.com> writes:
>>>>
>>>> sd->save_area should be freed in error path
>>> Oh, it's strange. This is already fixed in my previous patch : [PATCH v2] KVM:
>>> SVM: Fix potential memory leak in svm_cpu_init().
>>> And Vitaly and Liran gave me Reviewed-by tags and Paolo queued it one
>>> month ago. But I can't found it in master or queue branch. There might
>>> be something wrong. :(
>>
>> In fact, I send this patch 2019/02/, and get Reviewed-by, but did not queue
>>
>> https://patchwork.kernel.org/patch/10853973/
>>
>> and resend it 2019/07
>>
>> https://patchwork.kernel.org/patch/11032081/
>>
>
> Oh, it's really a pit. And in this case, we can get rid of the var r as '-ENOMEM' is actually the only possible outcome here, as
> suggested by Vitaly, which looks like this: https://lkml.org/lkml/2020/1/15/933
I queued your patch again, sorry to both of you.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][resend] KVM: fix error handling in svm_cpu_init
@ 2020-02-20 8:40 linmiaohe
2020-02-21 16:58 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: linmiaohe @ 2020-02-20 8:40 UTC (permalink / raw)
To: Li,Rongqing; +Cc: Liran Alon, kvm, linux-kernel, x86, pbonzini, vkuznets
Li,Rongqing <lirongqing@baidu.com> writes:
>> Hi,
>> Li RongQing <lirongqing@baidu.com> writes:
>> >
>> >sd->save_area should be freed in error path
>> Oh, it's strange. This is already fixed in my previous patch : [PATCH v2] KVM:
>> SVM: Fix potential memory leak in svm_cpu_init().
>> And Vitaly and Liran gave me Reviewed-by tags and Paolo queued it one
>> month ago. But I can't found it in master or queue branch. There might
>> be something wrong. :(
>
>In fact, I send this patch 2019/02/, and get Reviewed-by, but did not queue
>
>https://patchwork.kernel.org/patch/10853973/
>
>and resend it 2019/07
>
>https://patchwork.kernel.org/patch/11032081/
>
Oh, it's really a pit. And in this case, we can get rid of the var r as '-ENOMEM' is actually the only possible outcome here, as
suggested by Vitaly, which looks like this: https://lkml.org/lkml/2020/1/15/933
Thanks. :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH][resend] KVM: fix error handling in svm_cpu_init
@ 2020-02-20 7:39 Li RongQing
0 siblings, 0 replies; 7+ messages in thread
From: Li RongQing @ 2020-02-20 7:39 UTC (permalink / raw)
To: pbonzini, sean.j.christopherson, vkuznets, wanpengli, x86, kvm,
linux-kernel
sd->save_area should be freed in error path
Fixes: 70cd94e60c733 ("KVM: SVM: VMRUN should use associated ASID when SEV is enabled")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/svm.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index a3e32d61d60c..b8e948c65f51 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1014,7 +1014,7 @@ static int svm_cpu_init(int cpu)
r = -ENOMEM;
sd->save_area = alloc_page(GFP_KERNEL);
if (!sd->save_area)
- goto err_1;
+ goto err_free_sd;
if (svm_sev_enabled()) {
r = -ENOMEM;
@@ -1022,14 +1022,16 @@ static int svm_cpu_init(int cpu)
sizeof(void *),
GFP_KERNEL);
if (!sd->sev_vmcbs)
- goto err_1;
+ goto err_free_saved_area;
}
per_cpu(svm_data, cpu) = sd;
return 0;
-err_1:
+err_free_saved_area:
+ __free_page(sd->save_area);
+err_free_sd:
kfree(sd);
return r;
--
2.16.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH][resend] KVM: fix error handling in svm_cpu_init
@ 2019-07-05 6:29 Li RongQing
0 siblings, 0 replies; 7+ messages in thread
From: Li RongQing @ 2019-07-05 6:29 UTC (permalink / raw)
To: pbonzini, x86, kvm, vkuznets, brijesh.singh
sd->save_area should be freed in error path
Fixes: 70cd94e60c733 ("KVM: SVM: VMRUN should use associated ASID when SEV is enabled")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/svm.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 48c865a4e5dd..a69eff0aa40b 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -999,7 +999,7 @@ static int svm_cpu_init(int cpu)
r = -ENOMEM;
sd->save_area = alloc_page(GFP_KERNEL);
if (!sd->save_area)
- goto err_1;
+ goto err_free_sd;
if (svm_sev_enabled()) {
r = -ENOMEM;
@@ -1007,14 +1007,16 @@ static int svm_cpu_init(int cpu)
sizeof(void *),
GFP_KERNEL);
if (!sd->sev_vmcbs)
- goto err_1;
+ goto err_free_saved_area;
}
per_cpu(svm_data, cpu) = sd;
return 0;
-err_1:
+err_free_saved_area:
+ __free_page(sd->save_area);
+err_free_sd:
kfree(sd);
return r;
--
2.16.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-02-24 2:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 8:18 [PATCH][resend] KVM: fix error handling in svm_cpu_init linmiaohe
2020-02-20 8:31 ` 答复: " Li,Rongqing
-- strict thread matches above, loose matches on Subject: below --
2020-02-24 2:08 linmiaohe
2020-02-20 8:40 linmiaohe
2020-02-21 16:58 ` Paolo Bonzini
2020-02-20 7:39 Li RongQing
2019-07-05 6:29 Li RongQing
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.