Received: by 10.213.65.68 with SMTP id h4csp433509imn; Tue, 13 Mar 2018 08:55:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELtRcvczwbdds8PbKrspFank7xFNVaL4Ks25o6mJrOeSYMJNkC8JYiQowgyT4z1+QXCOCUEB X-Received: by 10.98.69.76 with SMTP id s73mr1089871pfa.31.1520956549521; Tue, 13 Mar 2018 08:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520956549; cv=none; d=google.com; s=arc-20160816; b=y1FBS0PiuJtXqq7WPxosijhqZq4Xv4pC2KFtMdyM+xDbjzqxBn1Tc4qI/7XvnbQTV9 +tp0UPmd+ktI4aCm/cvtCGLgovYgG7E1UiaBwWv/6GfhSu4VLweaImPtRCiFJC1ry0/r hoS6pvotteBqAsm4FAml0Yaa45kcJe61Qb9ikJGzRbDS4Ii52Mb9/XyjylROmRGjbtDb 9q1ltDLFeUsol8/fvI/ekFeDpABlPyxvuuq56kmvcrtkAq/aqwkrOF+7yJNsH4SHzMXw 1pWW5n1MyTPvFBSYC4tEFyCcYj/SRGqlBObRQNLIAfLQRRHV0ppe/sjFz6KylONRrjlo vaKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0HMRlNgnkpS2aUFNpEYIlnpEWp+vekZ/VPqt5YZ2TJI=; b=xprFtvv5GuEh8l+TontsusaLjTQX7xlgBEPBaeFJ/RsXUt/CyCKN+3Xk/xkrMY/Gad pVmPyV0HDHW0RO+c7PP7x0er2ZUMMUtbJDS3CNK3FEEQ4hqp9noREAJkUQYwpYpAug3d jUGhHMwH15+NY3vaSCh0cwAvdmCWjdfL8lZrLobb2HjXwVl8YizHStoqNZ6pAoV15f32 ox7G8ag8ZabVbwcjlK+DFF8mxNHHnN6NXuAOuOnJMw+KdPugPzXUBhQFdVtVG2U3cGVA O40A/1hRxjP73rnpRs+iPMyIMNquXkGodhekTG0Y3gtAZPsPSbZlOejkNOyEX8D7gdUR LS4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si285753pfi.323.2018.03.13.08.55.34; Tue, 13 Mar 2018 08:55:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934768AbeCMPyA (ORCPT + 99 others); Tue, 13 Mar 2018 11:54:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35232 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934685AbeCMPjN (ORCPT ); Tue, 13 Mar 2018 11:39:13 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4FBDBF43; Tue, 13 Mar 2018 15:39:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Borntraeger , David Hildenbrand , Cornelia Huck Subject: [PATCH 4.14 089/140] KVM: s390: fix memory overwrites when not using SCA entries Date: Tue, 13 Mar 2018 16:24:52 +0100 Message-Id: <20180313152504.116029117@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Hildenbrand commit f07afa0462b76a5b9c4f3a43d5ac24fdb86a90c2 upstream. 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: a6940674c384 ("KVM: s390: allow 255 VCPUs when sca entries aren't used") Reported-by: Christian Borntraeger Tested-by: Christian Borntraeger Signed-off-by: David Hildenbrand Message-Id: <20180306132758.21034-1-david@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger Signed-off-by: Greg Kroah-Hartman --- arch/s390/kvm/kvm-s390.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -2119,6 +2119,7 @@ static void sca_add_vcpu(struct kvm_vcpu /* we still need the basic sca for the ipte control */ vcpu->arch.sie_block->scaoh = (__u32)(((__u64)sca) >> 32); vcpu->arch.sie_block->scaol = (__u32)(__u64)sca; + return; } read_lock(&vcpu->kvm->arch.sca_lock); if (vcpu->kvm->arch.use_esca) {