qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled.
@ 2008-12-15 22:41 Gerd Hoffmann
  2008-12-15 23:18 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2008-12-15 22:41 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

  Hi,

If you see crashes after commit 6060, try this one ;)

Not initializing msr_list.nmsrs before the KVM_GET_MSR_INDEX_LIST ioctl
will make the kernel fill too much data into msr_list, thereby
overflowing the stack and crashing the qemu.

cheers,
  Gerd

[-- Attachment #2: 0045-Fix-qemu-crash-with-kvm-enabled.patch --]
[-- Type: text/plain, Size: 999 bytes --]

>From cb6c5b6fde117fe05699230c43c3163e91dbb3cd Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 9 Dec 2008 17:42:27 +0100
Subject: [PATCH] Fix qemu crash with kvm enabled.


Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 target-i386/kvm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index effd5af..db11ac2 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -104,11 +104,11 @@ static int kvm_has_msr_star(CPUState *env)
 
         /* Obtain MSR list from KVM.  These are the MSRs that we must
          * save/restore */
+        msr_list.nmsrs = 0;
         ret = kvm_ioctl(env->kvm_state, KVM_GET_MSR_INDEX_LIST, &msr_list);
         if (ret < 0)
             return 0;
 
-        msr_list.nmsrs = 0;
         kvm_msr_list = qemu_mallocz(sizeof(msr_list) +
                                     msr_list.nmsrs * sizeof(msr_list.indices[0]));
         if (kvm_msr_list == NULL)
-- 
1.5.6.5


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

* Re: [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled.
  2008-12-15 22:41 [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled Gerd Hoffmann
@ 2008-12-15 23:18 ` Anthony Liguori
  2008-12-16 11:05   ` Gerd Hoffmann
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2008-12-15 23:18 UTC (permalink / raw)
  To: qemu-devel

Gerd Hoffmann wrote:
>   Hi,
>
> If you see crashes after commit 6060, try this one ;)
>
> Not initializing msr_list.nmsrs before the KVM_GET_MSR_INDEX_LIST ioctl
> will make the kernel fill too much data into msr_list, thereby
> overflowing the stack and crashing the qemu.
>   

I've applied that.  Or at least I thoguht I did.

Regards,

Anthony Liguori

> cheers,
>   Gerd
>   

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

* Re: [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled.
  2008-12-15 23:18 ` Anthony Liguori
@ 2008-12-16 11:05   ` Gerd Hoffmann
  0 siblings, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2008-12-16 11:05 UTC (permalink / raw)
  To: qemu-devel

Anthony Liguori wrote:
> Gerd Hoffmann wrote:
>>   Hi,
>>
>> If you see crashes after commit 6060, try this one ;)
>>
>> Not initializing msr_list.nmsrs before the KVM_GET_MSR_INDEX_LIST ioctl
>> will make the kernel fill too much data into msr_list, thereby
>> overflowing the stack and crashing the qemu.
> 
> I've applied that.  Or at least I thoguht I did.

Yes, is in, I somehow missed the commit message.

thanks,
  Gerd

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

end of thread, other threads:[~2008-12-16 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 22:41 [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled Gerd Hoffmann
2008-12-15 23:18 ` Anthony Liguori
2008-12-16 11:05   ` Gerd Hoffmann

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).