lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 09 Sep 2021 07:19:53 +0200
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Yu Zhang <yu.c.zhang@...ux.intel.com>, seanjc@...gle.com,
        pbonzini@...hat.com
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        wanpengli@...cent.com, jmattson@...gle.com, joro@...tes.org
Subject: Re: [PATCH] KVM: nVMX: Reset vmxon_ptr upon VMXOFF emulation.

Yu Zhang <yu.c.zhang@...ux.intel.com> writes:

> From: Vitaly Kuznetsov <vkuznets@...hat.com>
>
> Currently, 'vmx->nested.vmxon_ptr' is not reset upon VMXOFF
> emulation. This is not a problem per se as we never access
> it when !vmx->nested.vmxon. But this should be done to avoid
> any issue in the future.
>
> Also, initialize the vmxon_ptr when vcpu is created.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>

Thanks but even Suggested-by: would be enough :-)

> Signed-off-by: Yu Zhang <yu.c.zhang@...ux.intel.com>
> ---
>  arch/x86/kvm/vmx/nested.c | 1 +
>  arch/x86/kvm/vmx/vmx.c    | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 90f34f12f883..e4260f67caac 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -289,6 +289,7 @@ static void free_nested(struct kvm_vcpu *vcpu)
>  	kvm_clear_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu);
>  
>  	vmx->nested.vmxon = false;
> +	vmx->nested.vmxon_ptr = -1ull;
>  	vmx->nested.smm.vmxon = false;
>  	free_vpid(vmx->nested.vpid02);
>  	vmx->nested.posted_intr_nv = -1;
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 0c2c0d5ae873..9a3e35c038f2 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -6886,6 +6886,7 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu)
>  
>  	vcpu_setup_sgx_lepubkeyhash(vcpu);
>  
> +	vmx->nested.vmxon_ptr = -1ull;
>  	vmx->nested.posted_intr_nv = -1;
>  	vmx->nested.current_vmptr = -1ull;
>  	vmx->nested.hv_evmcs_vmptr = EVMPTR_INVALID;

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ