From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled.
Date: Mon, 15 Dec 2008 23:41:55 +0100 [thread overview]
Message-ID: <4946DD33.4070608@redhat.com> (raw)
[-- 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
next reply other threads:[~2008-12-15 22:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-15 22:41 Gerd Hoffmann [this message]
2008-12-15 23:18 ` [Qemu-devel] [RESEND PATCH] Fix qemu crash with kvm enabled Anthony Liguori
2008-12-16 11:05 ` Gerd Hoffmann
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=4946DD33.4070608@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 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).