Skip to contentSkip to conversation

i386: kvmvapic: initialise imm32 variable

PATCH Applied P J P 2 participants 2 messages Apr 7, 2016

lore
Share & tools
lore

P J P

author
#0 lore raw

PATCH 1/1 i386: kvmvapic: initialise imm32 variable

From: Prasad J Pandit <[email protected]>

When processing Task Priorty Register(TPR) access, it could leak automatic stack variable 'imm32' in patch_instruction(). Initialise the variable to avoid it.

Reported by: Donghai Zdh <[email protected]>

---
 hw/i386/kvmvapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/kvmvapic.c +1 -1
index c69f374..ff1e31a 100644
@@ -394,7 +394,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
     CPUX86State *env = &cpu->env;
     VAPICHandlers *handlers;
     uint8_t opcode[2];
-    uint32_t imm32;
+    uint32_t imm32 = 0;
     target_ulong current_pc = 0;
     target_ulong current_cs_base = 0;
     int current_flags = 0;
Signature · 1 line
2.5.5
#1 lore raw
Quoted 19 lines · P J P

From: Prasad J Pandit <[email protected]>

When processing Task Priorty Register(TPR) access, it could leak automatic stack variable 'imm32' in patch_instruction(). Initialise the variable to avoid it.

Reported by: Donghai Zdh <[email protected]>

---
 hw/i386/kvmvapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/kvmvapic.c +0 -0
index c69f374..ff1e31a 100644

hw/i386/kvmvapic.c static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip) · line 400

Quoted 8 lines
hw/i386/kvmvapic.c +1 -1
@@ -394,7 +394,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
     CPUX86State *env = &cpu->env;
     VAPICHandlers *handlers;
     uint8_t opcode[2];
-    uint32_t imm32;
+    uint32_t imm32 = 0;
     target_ulong current_pc = 0;
     target_ulong current_cs_base = 0;
     int current_flags = 0;

Queued for 2.6, thanks.

Paolo