All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [patch] fix qemu crash with kvm enabled.
Date: Tue, 09 Dec 2008 17:46:31 +0100	[thread overview]
Message-ID: <493EA0E7.9010302@redhat.com> (raw)

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

  Hi,

Without this initialization fix the kvm ioctl will overflow msr_list,
thereby killing the stack and crash qemu.

please apply,
  Gerd

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

>From 00aa7c185585ebfcddf481acfa3f0b5ab9e41486 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


                 reply	other threads:[~2008-12-09 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=493EA0E7.9010302@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.