]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: Fix the bitmap range to copy during clear dirty
authorPeter Xu <peterx@redhat.com>
Wed, 8 May 2019 09:15:45 +0000 (17:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:39:56 +0000 (07:39 +0200)
commit12b014bdca345ef37a575f481efbc920282f89ed
tree8498944213d8c9fbd1848a6f56e54d4ab21e7648
parent2f6ef23f1ffd83028533cb55403c18241fe506e9
KVM: Fix the bitmap range to copy during clear dirty

commit 4ddc9204572c33f2eb91fbdb1d99d8078388b67d upstream.

kvm_dirty_bitmap_bytes() will return the size of the dirty bitmap of
the memslot rather than the size of bitmap passed over from the ioctl.
Here for KVM_CLEAR_DIRTY_LOG we should only copy exactly the size of
bitmap that covers kvm_clear_dirty_log.num_pages.

Signed-off-by: Peter Xu <peterx@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 2a31b9db153530df4aa02dac8c32837bf5f47019
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/kvm_main.c