From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LA5jL-0001F4-Nq for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:46:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LA5jJ-0001Cs-Tl for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:46:39 -0500 Received: from [199.232.76.173] (port=43093 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LA5jJ-0001CZ-LV for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:46:37 -0500 Received: from mx2.redhat.com ([66.187.237.31]:36312) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LA5jJ-0007Oa-37 for qemu-devel@nongnu.org; Tue, 09 Dec 2008 11:46:37 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mB9GkYhb029818 for ; Tue, 9 Dec 2008 11:46:36 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mB9GkXlQ020037 for ; Tue, 9 Dec 2008 11:46:33 -0500 Received: from zweiblum.travel.kraxel.org (vpn-10-149.str.redhat.com [10.32.10.149]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mB9GkVVp010891 for ; Tue, 9 Dec 2008 11:46:32 -0500 Message-ID: <493EA0E7.9010302@redhat.com> Date: Tue, 09 Dec 2008 17:46:31 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060001090703080008020202" Subject: [Qemu-devel] [patch] fix qemu crash with kvm enabled. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------060001090703080008020202 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, Without this initialization fix the kvm ioctl will overflow msr_list, thereby killing the stack and crash qemu. please apply, Gerd --------------060001090703080008020202 Content-Type: text/plain; name="0044-Fix-qemu-crash-with-kvm-enabled.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0044-Fix-qemu-crash-with-kvm-enabled.patch" >>From 00aa7c185585ebfcddf481acfa3f0b5ab9e41486 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 9 Dec 2008 17:42:27 +0100 Subject: [PATCH] Fix qemu crash with kvm enabled. Signed-off-by: Gerd Hoffmann --- 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 --------------060001090703080008020202--