KVM: x86: Initialize tdp_level during vCPU creation
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 27 May 2020 08:54:00 +0000 (01:54 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 May 2020 17:11:11 +0000 (13:11 -0400)
commit7d2e8748af62b0de7c7bbcb0d62f937e88fd7027
tree0157925ff958df24f3d6f472f1182d54111617f4
parent6c0238c4a62b3a0b1201aeb7e33a4636d552a436
KVM: x86: Initialize tdp_level during vCPU creation

Initialize vcpu->arch.tdp_level during vCPU creation to avoid consuming
garbage if userspace calls KVM_RUN without first calling KVM_SET_CPUID.

Fixes: e93fd3b3e89e9 ("KVM: x86/mmu: Capture TDP level when updating CPUID")
Reported-by: syzbot+904752567107eefb728c@syzkaller.appspotmail.com
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200527085400.23759-1-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c