From a0e4b0eb6fb0eedc3250857a29322ffaf6cedea6 Mon Sep 17 00:00:00 2001 Message-Id: <a0e4b0eb6fb0eedc3250857a29322ffaf6cedea6.1363792519.git.minovotn@redhat.com> In-Reply-To: <76f48f7faa6ca5742e3972153b490d00e74d5a93.1363792519.git.minovotn@redhat.com> References: <76f48f7faa6ca5742e3972153b490d00e74d5a93.1363792519.git.minovotn@redhat.com> From: Gleb Natapov <gleb@redhat.com> Date: Wed, 20 Mar 2013 11:25:51 +0100 Subject: [PATCH 4/4] do not #GP on unaligned MSR_KVM_SYSTEM_TIME write RH-Author: Gleb Natapov <gleb@redhat.com> Message-id: <20130320112551.GH3889@redhat.com> Patchwork-id: 49747 O-Subject: [PATCH RHEL5.10 RHEL5.9.z] do not #GP on unaligned MSR_KVM_SYSTEM_TIME write Bugzilla: RH-Acked-by: Petr Matousek <pmatouse@redhat.com> RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com> RHEL5.9.z BZ: 917018 RHEL5.10 BZ: 917019 Upstream commit: c300aa64ddf57d9c5d9c898a64b36877345dd4a9 Signed-off-by: Gleb Natapov <gleb@redhat.com> --- This patch goes on top of "KVM: Fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)" the actually code that was committed upstream was different so this patch makes rhel to be the same as upstream. -- Gleb. Signed-off-by: Michal Novotny <minovotn@redhat.com> --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e2d9bd0..525ccee 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -852,7 +852,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) /* Check that the address is 32-byte aligned. */ if (vcpu->arch.time_offset & (sizeof(struct pvclock_vcpu_time_info) - 1)) - return 1; + break; vcpu->arch.time_page = gfn_to_page(vcpu->kvm, data >> PAGE_SHIFT); -- 1.7.11.7