From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: Re: [PATCH] kvm: fix MSR_COUNT for kvm_arch_save_regs() Date: Fri, 16 Oct 2009 14:43:14 +0100 Message-ID: <1255700594.3072.25.camel@blaa> References: <20091014180227.GQ24126@blackpad.lan.raisama.net> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Ulrich Obergfell To: Eduardo Habkost Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32877 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753854AbZJPNp0 (ORCPT ); Fri, 16 Oct 2009 09:45:26 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9GDj0Qk011767 for ; Fri, 16 Oct 2009 09:45:00 -0400 In-Reply-To: <20091014180227.GQ24126@blackpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2009-10-14 at 15:02 -0300, Eduardo Habkost wrote: > A new register was added to the load/save list on commit > d283d5a65a2bdcc570065267be21848bd6fe3d78, but MSR_COUNT was not updated, leading > to potential stack corruption on kvm_arch_save_regs(). > > The following registers are saved by kvm_arch_save_regs(): > > 1) MSR_IA32_SYSENTER_CS > 2) MSR_IA32_SYSENTER_ESP > 3) MSR_IA32_SYSENTER_EIP > 4) MSR_STAR > 5) MSR_IA32_TSC > 6) MSR_VM_HSAVE_PA > 7) MSR_CSTAR (x86_64 only) > 8) MSR_KERNELGSBASE (x86_64 only) > 9) MSR_FMASK (x86_64 only) > 10) MSR_LSTAR (x86_64 only) > > Signed-off-by: Eduardo Habkost Forgot: Reported-by: Ulrich Obergfell Looks like the fix is needed on both stable-0.10 and stable-0.11 as well as master Cheers, Mark.