Commit 7c9abfb884b8737f0afdc8a88bcea77526f0da87
Exists in
master
and in
7 other branches
Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: get_tss_base_addr() should return a gpa_t KVM: x86: Catch potential overrun in MCE setup
Showing 1 changed file Side-by-side Diff
arch/x86/kvm/x86.c
... | ... | @@ -1692,7 +1692,7 @@ |
1692 | 1692 | unsigned bank_num = mcg_cap & 0xff, bank; |
1693 | 1693 | |
1694 | 1694 | r = -EINVAL; |
1695 | - if (!bank_num) | |
1695 | + if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS) | |
1696 | 1696 | goto out; |
1697 | 1697 | if (mcg_cap & ~(KVM_MCE_CAP_SUPPORTED | 0xff | 0xff0000)) |
1698 | 1698 | goto out; |
... | ... | @@ -4051,7 +4051,7 @@ |
4051 | 4051 | return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu); |
4052 | 4052 | } |
4053 | 4053 | |
4054 | -static u32 get_tss_base_addr(struct kvm_vcpu *vcpu, | |
4054 | +static gpa_t get_tss_base_addr(struct kvm_vcpu *vcpu, | |
4055 | 4055 | struct desc_struct *seg_desc) |
4056 | 4056 | { |
4057 | 4057 | u32 base_addr = get_desc_base(seg_desc); |