summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Honig <ahonig@google.com>2016-05-17 17:41:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-01 12:17:01 -0700
commit2aecd84724e43ea2f962ba54e10b9f304c258d16 (patch)
tree5ffb1546365cdbb13c9a0386e188db9c08d7da89
parent90566b26b924c0679401ca23dbd0a1785156c488 (diff)
downloadlinux-stable-2aecd84724e43ea2f962ba54e10b9f304c258d16.tar.gz
linux-stable-2aecd84724e43ea2f962ba54e10b9f304c258d16.tar.bz2
linux-stable-2aecd84724e43ea2f962ba54e10b9f304c258d16.zip
KVM: MTRR: remove MSR 0x2f8
commit 9842df62004f366b9fed2423e24df10542ee0dc5 upstream. MSR 0x2f8 accessed the 124th Variable Range MTRR ever since MTRR support was introduced by 9ba075a664df ("KVM: MTRR support"). 0x2f8 became harmful when 910a6aae4e2e ("KVM: MTRR: exactly define the size of variable MTRRs") shrinked the array of VR MTRRs from 256 to 8, which made access to index 124 out of bounds. The surrounding code only WARNs in this situation, thus the guest gained a limited read/write access to struct kvm_arch_vcpu. 0x2f8 is not a valid VR MTRR MSR, because KVM has/advertises only 16 VR MTRR MSRs, 0x200-0x20f. Every VR MTRR is set up using two MSRs, 0x2f8 was treated as a PHYSBASE and 0x2f9 would be its PHYSMASK, but 0x2f9 was not implemented in KVM, therefore 0x2f8 could never do anything useful and getting rid of it is safe. This fixes CVE-2016-3713. Fixes: 910a6aae4e2e ("KVM: MTRR: exactly define the size of variable MTRRs") Reported-by: David Matlack <dmatlack@google.com> Signed-off-by: Andy Honig <ahonig@google.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/x86/kvm/mtrr.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/x86/kvm/mtrr.c b/arch/x86/kvm/mtrr.c
index 3f8c732117ec..c146f3c262c3 100644
--- a/arch/x86/kvm/mtrr.c
+++ b/arch/x86/kvm/mtrr.c
@@ -44,8 +44,6 @@ static bool msr_mtrr_valid(unsigned msr)
case MSR_MTRRdefType:
case MSR_IA32_CR_PAT:
return true;
- case 0x2f8:
- return true;
}
return false;
}