kernel_optimize_test/arch/s390/kvm
Sean Christopherson 97daa028f3 KVM: s390: Return last valid slot if approx index is out-of-bounds
Return the index of the last valid slot from gfn_to_memslot_approx() if
its binary search loop yielded an out-of-bounds index.  The index can
be out-of-bounds if the specified gfn is less than the base of the
lowest memslot (which is also the last valid memslot).

Note, the sole caller, kvm_s390_get_cmma(), ensures used_slots is
non-zero.

Fixes: afdad61615 ("KVM: s390: Fix storage attributes migration with memory slots")
Cc: stable@vger.kernel.org # 4.19.x: 0774a964ef56: KVM: Fix out of range accesses to memslots
Cc: stable@vger.kernel.org # 4.19.x
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200408064059.8957-3-sean.j.christopherson@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-04-14 10:39:57 -04:00
..
diag.c KVM: s390: protvirt: Report CPU state to Ultravisor 2020-02-27 19:47:12 +01:00
gaccess.c KVM: s390: Use fallthrough; 2020-03-23 18:30:07 +01:00
gaccess.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
guestdbg.c KVM: s390: introduce defines for control registers 2018-05-17 09:02:27 +02:00
intercept.c KVM: s390: Features and Enhancements for 5.7 part1 2020-03-16 18:19:34 +01:00
interrupt.c KVM: s390: Use fallthrough; 2020-03-23 18:30:07 +01:00
irq.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
Kconfig * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
kvm-s390.c KVM: s390: Return last valid slot if approx index is out-of-bounds 2020-04-14 10:39:57 -04:00
kvm-s390.h KVM: s390: protvirt: Report CPU state to Ultravisor 2020-02-27 19:47:12 +01:00
Makefile KVM: s390: protvirt: Add initial vm and cpu lifecycle handling 2020-02-27 19:47:11 +01:00
priv.c KVM: s390: protvirt: STSI handling 2020-02-27 19:47:12 +01:00
pv.c KVM: s390: protvirt: Report CPU state to Ultravisor 2020-02-27 19:47:12 +01:00
sigp.c KVM: s390: introduce and use kvm_s390_test_cpuflags() 2018-01-24 17:46: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: vsie: Fix delivery of addressing exceptions 2020-04-07 13:12:34 +02:00