linux/arch/s390/kvm
Christian Borntraeger 1de1ea7efe KVM: s390: add proper locking for CMMA migration bitmap
Some parts of the cmma migration bitmap is already protected
with the kvm->lock (e.g. the migration start). On the other
hand the read of the cmma bits is not protected against a
concurrent free, neither is the emulation of the ESSA instruction.
Let's extend the locking to all related ioctls by using
the slots lock for
- kvm_s390_vm_start_migration
- kvm_s390_vm_stop_migration
- kvm_s390_set_cmma_bits
- kvm_s390_get_cmma_bits

In addition to that, we use synchronize_srcu before freeing
the migration structure as all users hold kvm->srcu for read.
(e.g. the ESSA handler).

Reported-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: stable@vger.kernel.org # 4.13+
Fixes: 190df4a212 (KVM: s390: CMMA tracking, ESSA emulation, migration mode)
Reviewed-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
2018-01-24 15:22:51 +01:00
..
diag.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
gaccess.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gaccess.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
guestdbg.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
intercept.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
interrupt.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
irq.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kvm-s390.c KVM: s390: add proper locking for CMMA migration bitmap 2018-01-24 15:22:51 +01:00
kvm-s390.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
Makefile KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
priv.c KVM: s390: prevent buffer overrun on memory hotplug during migration 2017-12-22 15:22:41 +01:00
sigp.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
trace-s390.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vsie.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00