Received: by 10.213.65.68 with SMTP id h4csp523888imn; Fri, 16 Mar 2018 10:20:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELtyxRNkkV1VmshMe5900Pz3vPpaIYD7vMdGTu4NoJcsCpbJlsgkM6dvndMOAXCmBiOMM2ov X-Received: by 2002:a17:902:a705:: with SMTP id w5-v6mr3005265plq.299.1521220836858; Fri, 16 Mar 2018 10:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521220836; cv=none; d=google.com; s=arc-20160816; b=Gfv91S4kTsZSUAKI23AitaTpCf3HfWfY1kiawUSOI/Lh7l25c5A25vPZOEV7fcRhsE St4yMbZapWNvYkFnONTb/vwuHywVHTPSi9gAhwD3K4hDSHL+KitkbX8T9nmqS6PJv3tk /j0OcRblyn4hvjJUD6uH6dLFvI826hQkU9hGXfAQgxX0NhRPFzotURvQeEPS9aQxAv2d uYVSk36lEKRSjuEbgLNyjcjg3nx2Eckr8GcOtA/kBd6VVxua8igcr6IW+Nx5PWeyFtDW +puBFd5cK3v1HQZqCQQaAKEklddaBocBI5D0dFx9xstU6I6rYaWQqXEjHgqHckgnqSMF vKjA== 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=k82zpL9TiMCRgluCmfd8fUZhmb34NNA883jQR/bNER4=; b=DZpD1PbtYqh3tS6YBCcyr7eLROFMu1qMouNrkmDGKzsLLXMbttWkVoV4PGvsGJqiSA qri4BD0c1kNMtdy/GrS30qFAdDd6K2qzX/K38D7WLGHAgY4LvAsO1Zw6ZGJNebn+EXxY Ha9pUj2nuKV/6uhzPHWhxAbxJ23eYcIYhRvgrPvqwKymstZxfsTs3iG6R8QXbkEd7ly8 7C6o05vxfmh07PuCGQy47+9dGHOMCTd3qJYAlYXJlvZ+/D2WleHFyTtfEZytoi84xRYM PB+C5OWYqqTMhBtUUoL60Ync9A2kBY2i8KvqByrjwFNiXKkk/zUW8n4Fn6HVA6Jhj78H TSzw== 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 e34-v6si6459273plb.588.2018.03.16.10.20.23; Fri, 16 Mar 2018 10:20:36 -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 S933113AbeCPRR1 (ORCPT + 99 others); Fri, 16 Mar 2018 13:17:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36576 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754380AbeCPPae (ORCPT ); Fri, 16 Mar 2018 11:30:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 93A7A1148; Fri, 16 Mar 2018 15:30:33 +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.9 23/86] KVM: s390: fix memory overwrites when not using SCA entries Date: Fri, 16 Mar 2018 16:22:46 +0100 Message-Id: <20180316152318.939963790@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152317.167709497@linuxfoundation.org> References: <20180316152317.167709497@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.9-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 @@ -1601,6 +1601,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) {