linux-stable/virt/kvm
Paolo Bonzini 65c4189de8 KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size
If a memory slot's size is not a multiple of 64 pages (256K), then
the KVM_CLEAR_DIRTY_LOG API is unusable: clearing the final 64 pages
either requires the requested page range to go beyond memslot->npages,
or requires log->num_pages to be unaligned, and kvm_clear_dirty_log_protect
requires log->num_pages to be both in range and aligned.

To allow this case, allow log->num_pages not to be a multiple of 64 if
it ends exactly on the last page of the slot.

Reported-by: Peter Xu <peterx@redhat.com>
Fixes: 98938aa8ed ("KVM: validate userspace input in kvm_clear_dirty_log_protect()", 2019-01-02)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-04-30 21:32:19 +02:00
..
arm kvm: move KVM_CAP_NR_MEMSLOTS to common code 2019-04-16 15:39:08 +02:00
Kconfig KVM: polling: add architecture backend to disable polling 2019-04-26 09:08:17 +02:00
async_pf.c KVM: fix some typos 2018-12-21 11:28:26 +01: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: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01: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 kvm: don't redefine flags as something else 2019-03-28 17:28:59 +01:00
irqchip.c KVM: fix spectrev1 gadgets 2019-04-16 15:38:07 +02:00
kvm_main.c KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size 2019-04-30 21:32:19 +02:00
vfio.c kvm: Add memcg accounting to KVM allocations 2019-02-20 22:48:29 +01: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