85f4aff
From: Prasad J Pandit <pjp@fedoraproject.org>
85f4aff
Date: Thu, 7 Apr 2016 12:50:08 +0530
85f4aff
Subject: [PATCH] i386: kvmvapic: initialise imm32 variable
85f4aff
85f4aff
When processing Task Priorty Register(TPR) access, it could leak
85f4aff
automatic stack variable 'imm32' in patch_instruction().
85f4aff
Initialise the variable to avoid it.
85f4aff
85f4aff
Reported by: Donghai Zdh <donghai.zdh@alibaba-inc.com>
85f4aff
Cc: qemu-stable@nongnu.org
85f4aff
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
85f4aff
Message-Id: <1460013608-16670-1-git-send-email-ppandit@redhat.com>
85f4aff
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
85f4aff
85f4aff
(cherry picked from commit 691a02e2ce0c413236a78dee6f2651c937b09fb0)
85f4aff
---
85f4aff
 hw/i386/kvmvapic.c | 2 +-
85f4aff
 1 file changed, 1 insertion(+), 1 deletion(-)
85f4aff
85f4aff
diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
85f4aff
index f0922da..97f3646 100644
85f4aff
--- a/hw/i386/kvmvapic.c
85f4aff
+++ b/hw/i386/kvmvapic.c
85f4aff
@@ -393,7 +393,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
85f4aff
     CPUX86State *env = &cpu->env;
85f4aff
     VAPICHandlers *handlers;
85f4aff
     uint8_t opcode[2];
85f4aff
-    uint32_t imm32;
85f4aff
+    uint32_t imm32 = 0;
85f4aff
     target_ulong current_pc = 0;
85f4aff
     target_ulong current_cs_base = 0;
85f4aff
     int current_flags = 0;