diff options
author | Janosch Frank <[email protected]> | 2017-02-02 16:39:31 +0100 |
---|---|---|
committer | Christian Borntraeger <[email protected]> | 2017-02-06 11:20:12 +0100 |
commit | e1e8a9624f7ba8ead4f056ff558ed070e86fa747 (patch) | |
tree | acd01ff17218b3328b1f390ddc87caca6f1dfbb1 | |
parent | a8c39dd77cb9fad0d0e5c5e6581851bdcbc1e6f6 (diff) |
KVM: s390: Disable dirty log retrieval for UCONTROL guests
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.")
Cc: <[email protected]> # 3.16+
Signed-off-by: Janosch Frank <[email protected]>
Reported-by: Martin Schwidefsky <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index dabd3b15bf11..502de74ea984 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -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; |