Skip to content

Commit f07afa0

Browse files
davidhildenbrandborntraeger
authored andcommitted
KVM: s390: fix memory overwrites when not using SCA entries
Even if we don't have extended SCA support, we can have more than 64 CPUs if we don't enable any HW features that might use the SCA entries. Now, this works just fine, but we missed a return, which is why we would actually store the SCA entries. If we have more than 64 CPUs, this means writing outside of the basic SCA - bad. Let's fix this. This allows > 64 CPUs when running nested (under vSIE) without random crashes. Fixes: a694067 ("KVM: s390: allow 255 VCPUs when sca entries aren't used") Reported-by: Christian Borntraeger <borntraeger@de.ibm.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180306132758.21034-1-david@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
1 parent 09a0fb6 commit f07afa0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,6 +2147,7 @@ static void sca_add_vcpu(struct kvm_vcpu *vcpu)
21472147
/* we still need the basic sca for the ipte control */
21482148
vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32);
21492149
vcpu->arch.sie_block->scaol = (__u32)(__u64)sca;
2150+
return;
21502151
}
21512152
read_lock(&vcpu->kvm->arch.sca_lock);
21522153
if (vcpu->kvm->arch.use_esca) {

0 commit comments

Comments
 (0)