Received: by 10.213.65.68 with SMTP id h4csp467918imn; Tue, 13 Mar 2018 10:00:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELsBjEqxvcI6WgBehNZwmDTTRFnV57fjALfEaxflmzrC7QSOx+s9p4P7krkMf2CP6b3s+9h9 X-Received: by 2002:a17:902:bd8c:: with SMTP id q12-v6mr1192967pls.364.1520960427884; Tue, 13 Mar 2018 10:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520960427; cv=none; d=google.com; s=arc-20160816; b=SMxpuNEnK3UdN1ZBJxMg2BYmMhiAR6A0q+/3cOR0AS1PYWPfq3lIVvLNLYtcVIrfCg xeOzJB3gAywpcu8AZltAI4s2D8v7QDU+eqRFYH2rZNMsspyIjyNC8NfxvU8VV+zJ53mN uFlcahFuOjORjWVGl8m7rSunGiNp53+oB8inPBZb7KvJBT+4CNmCfnwuCNebVKBmC8eX VVIiNvCRh8CGtTHov0ZjOcy1HO4ZLT43Qbj7e5Qhv3jlH2Sd+47C7XcBdILVgGhK5Ccf t1FqEykWKodLHNl27riKHvkXucfvXN6PdugJ0AvZlqUzFBtZACJ0KXZ3XJ3B3uZtXvwL FVhw== 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=gjE0g4KPD8S22Y9gMWeel5XM5l+6Om1tyahMvELWnoc=; b=haMEADxoI+UCJAZOQ3QqG1NzSFk9AXshRo1lfoO94xWKSy7pp5JHO9cnnel5ENjtIV pmMuhMVsImsWukCPNO8FgM+HzgZv4gN0ZqS5C+GevYz6T7pXu2ervXAajmACwpckqzQM 6c0OcgXbbk6ZG09IVs/StW/T84MMbT4PKb7Z5jJUbVQlanr+h+bYvuhiMRxZESP22N67 aXLTKcRnalh54nOCEcX1GxSePyUwfyrxVv4MdFeYw7d42ZYNSQoKGYerZR7Ni26pwgHu GcIFa4ywMXfIfmMIIPLcJQikuQYRvKQQkVr3SjyfId+vbcvE4+KvjTtQhgfK1t+0WXMB nCaw== 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 i2si375231pgf.145.2018.03.13.10.00.13; Tue, 13 Mar 2018 10:00:27 -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 S933132AbeCMP3z (ORCPT + 99 others); Tue, 13 Mar 2018 11:29:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58566 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932995AbeCMP3x (ORCPT ); Tue, 13 Mar 2018 11:29:53 -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 BD51EFC6; Tue, 13 Mar 2018 15:29:52 +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.15 053/146] KVM: s390: fix memory overwrites when not using SCA entries Date: Tue, 13 Mar 2018 16:23:40 +0100 Message-Id: <20180313152324.733971401@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@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.15-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 @@ -2118,6 +2118,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) {