kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: nVMX: Set cached_vmcs12 and cached_shadow_vmcs12 NULL after free
@ 2019-07-21 14:01 Jan Kiszka
  2019-07-22 11:50 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2019-07-21 14:01 UTC (permalink / raw)
  To: Paolo Bonzini, kvm; +Cc: Liran Alon

From: Jan Kiszka <jan.kiszka@siemens.com>

Shall help finding use-after-free bugs earlier.

Suggested-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 arch/x86/kvm/vmx/nested.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 4cdab4b4eff1..ced9fba32598 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -234,7 +234,9 @@ static void free_nested(struct kvm_vcpu *vcpu)
 		vmx->vmcs01.shadow_vmcs = NULL;
 	}
 	kfree(vmx->nested.cached_vmcs12);
+	vmx->nested.cached_vmcs12 = NULL;
 	kfree(vmx->nested.cached_shadow_vmcs12);
+	vmx->nested.cached_shadow_vmcs12 = NULL;
 	/* Unpin physical memory we referred to in the vmcs02 */
 	if (vmx->nested.apic_access_page) {
 		kvm_release_page_dirty(vmx->nested.apic_access_page);
--
2.16.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: nVMX: Set cached_vmcs12 and cached_shadow_vmcs12 NULL after free
  2019-07-21 14:01 [PATCH] KVM: nVMX: Set cached_vmcs12 and cached_shadow_vmcs12 NULL after free Jan Kiszka
@ 2019-07-22 11:50 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-07-22 11:50 UTC (permalink / raw)
  To: Jan Kiszka, kvm; +Cc: Liran Alon

On 21/07/19 16:01, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Shall help finding use-after-free bugs earlier.
> 
> Suggested-by: Liran Alon <liran.alon@oracle.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  arch/x86/kvm/vmx/nested.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 4cdab4b4eff1..ced9fba32598 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -234,7 +234,9 @@ static void free_nested(struct kvm_vcpu *vcpu)
>  		vmx->vmcs01.shadow_vmcs = NULL;
>  	}
>  	kfree(vmx->nested.cached_vmcs12);
> +	vmx->nested.cached_vmcs12 = NULL;
>  	kfree(vmx->nested.cached_shadow_vmcs12);
> +	vmx->nested.cached_shadow_vmcs12 = NULL;
>  	/* Unpin physical memory we referred to in the vmcs02 */
>  	if (vmx->nested.apic_access_page) {
>  		kvm_release_page_dirty(vmx->nested.apic_access_page);
> --
> 2.16.4
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-22 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-21 14:01 [PATCH] KVM: nVMX: Set cached_vmcs12 and cached_shadow_vmcs12 NULL after free Jan Kiszka
2019-07-22 11:50 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).