On 21/07/19 16:01, Jan Kiszka wrote: > From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> > > Shall help finding use-after-free bugs earlier. > > Suggested-by: Liran Alon <liran.alon@xxxxxxxxxx> > Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> > --- > 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