]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
KVM: s390: Disable dirty log retrieval for UCONTROL guests
authorJanosch Frank <frankja@linux.vnet.ibm.com>
Thu, 2 Feb 2017 15:39:31 +0000 (16:39 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Wed, 15 Mar 2017 15:32:11 +0000 (10:32 -0500)
BugLink: http://bugs.launchpad.net/bugs/1673118
commit e1e8a9624f7ba8ead4f056ff558ed070e86fa747 upstream.

User controlled KVM guests do not support the dirty log, as they have
no single gmap that we can check for changes.

As they have no single gmap, kvm->arch.gmap is NULL and all further
referencing to it for dirty checking will result in a NULL
dereference.

Let's return -EINVAL if a caller tries to sync dirty logs for a
UCONTROL guest.

Fixes: 15f36eb ("KVM: s390: Add proper dirty bitmap support to S390 kvm.")
Signed-off-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Reported-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/s390/kvm/kvm-s390.c

index 6484a250021e2717c448eb8f4f0b987169c264f1..ac9eb595f0aa42787debcf2b2b7efa43d42deda9 100644 (file)
@@ -442,6 +442,9 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
        struct kvm_memory_slot *memslot;
        int is_dirty = 0;
 
+       if (kvm_is_ucontrol(kvm))
+               return -EINVAL;
+
        mutex_lock(&kvm->slots_lock);
 
        r = -EINVAL;