1
0
Fork 0
alistair23-linux/virt/kvm
Jim Mattson f1b9dd5eb8 kvm: Disallow wraparound in kvm_gfn_to_hva_cache_init
Previously, in the case where (gpa + len) wrapped around, the entire
region was not validated, as the comment claimed. It doesn't actually
seem that wraparound should be allowed here at all.

Furthermore, since some callers don't check the return code from this
function, it seems prudent to clear ghc->memslot in the event of an
error.

Fixes: 8f964525a1 ("KVM: Allow cross page reads and writes from cached translations.")
Reported-by: Cfir Cohen <cfir@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Cfir Cohen <cfir@google.com>
Reviewed-by: Marc Orr <marcorr@google.com>
Cc: Andrew Honig <ahonig@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
2018-12-21 11:28:22 +01:00
..
arm KVM/arm updates for 4.21 2018-12-19 20:33:55 +01:00
Kconfig KVM: arm64: Prevent KVM_COMPAT from being selected 2018-06-21 17:17:50 +01:00
async_pf.c sched/swait: Rename to exclusive 2018-06-20 11:35:56 +02:00
async_pf.h KVM: fix checkpatch.pl errors in kvm/async_pf.h 2015-06-19 17:16:25 +02:00
coalesced_mmio.c kvm/x86 : add coalesced pio support 2018-10-17 00:30:11 +02:00
coalesced_mmio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
eventfd.c Miscellaneous bugfixes, plus a small patchlet related to Spectre v2. 2018-07-18 11:08:44 -07:00
irqchip.c KVM: use rcu access function for irq routing 2017-07-07 15:24:15 +02:00
kvm_main.c kvm: Disallow wraparound in kvm_gfn_to_hva_cache_init 2018-12-21 11:28:22 +01:00
vfio.c vfio: New external user group/file match 2017-06-28 13:50:05 -06:00
vfio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00