qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] i386: kvmvapic: initialise imm32 variable
@ 2016-04-07  7:20 P J P
  2016-04-07  8:47 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: P J P @ 2016-04-07  7:20 UTC (permalink / raw)
  To: Qemu Developers; +Cc: Paolo Bonzini, Prasad J Pandit, Donghai Zdh

From: Prasad J Pandit <pjp@fedoraproject.org>

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 <donghai.zdh@alibaba-inc.com>

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 hw/i386/kvmvapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
index c69f374..ff1e31a 100644
--- a/hw/i386/kvmvapic.c
+++ b/hw/i386/kvmvapic.c
@@ -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;
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] i386: kvmvapic: initialise imm32 variable
  2016-04-07  7:20 [Qemu-devel] [PATCH] i386: kvmvapic: initialise imm32 variable P J P
@ 2016-04-07  8:47 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-04-07  8:47 UTC (permalink / raw)
  To: P J P, Qemu Developers; +Cc: Donghai Zdh, Prasad J Pandit



On 07/04/2016 09:20, P J P wrote:
> From: Prasad J Pandit <pjp@fedoraproject.org>
> 
> 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 <donghai.zdh@alibaba-inc.com>
> 
> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
> ---
>  hw/i386/kvmvapic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c
> index c69f374..ff1e31a 100644
> --- a/hw/i386/kvmvapic.c
> +++ b/hw/i386/kvmvapic.c
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-07  7:20 [Qemu-devel] [PATCH] i386: kvmvapic: initialise imm32 variable P J P
2016-04-07  8:47 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).