[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1582213006-488-1-git-send-email-linmiaohe@huawei.com>
Date: Thu, 20 Feb 2020 23:36:46 +0800
From: linmiaohe <linmiaohe@...wei.com>
To: <pbonzini@...hat.com>, <rkrcmar@...hat.com>,
<sean.j.christopherson@...el.com>, <vkuznets@...hat.com>,
<wanpengli@...cent.com>, <jmattson@...gle.com>, <joro@...tes.org>,
<tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<hpa@...or.com>
CC: <linmiaohe@...wei.com>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <x86@...nel.org>
Subject: [PATCH] KVM: apic: avoid calculating pending eoi from an uninitialized val
From: Miaohe Lin <linmiaohe@...wei.com>
When get user eoi value failed, var val would be uninitialized and result
in calculating pending eoi from an uninitialized val. Initialize var val
to 0 to fix this case.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
arch/x86/kvm/lapic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 4f14ec7525f6..7e77e94f3176 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -626,7 +626,7 @@ static inline bool pv_eoi_enabled(struct kvm_vcpu *vcpu)
static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu)
{
- u8 val;
+ u8 val = 0;
if (pv_eoi_get_user(vcpu, &val) < 0)
printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n",
(unsigned long long)vcpu->arch.pv_eoi.msr_val);
--
2.19.1
Powered by blists - more mailing lists