From patchwork Mon Mar 15 13:57:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 401444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AED6C2BA19 for ; Mon, 15 Mar 2021 14:01:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0291664EFD for ; Mon, 15 Mar 2021 14:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233169AbhCOOA5 (ORCPT ); Mon, 15 Mar 2021 10:00:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbhCON7f (ORCPT ); Mon, 15 Mar 2021 09:59:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A594164F58; Mon, 15 Mar 2021 13:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816754; bh=xpwWOfKkxd4nnhLg46f86jxhAN1cBRgdz4QIhtpDBWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HzbHt5iWQyNY9q8zhl5MysbT3Lsw5NxxzUfUwlzdUiPUK0f6ecGJ+AMoB9mnda8aV s5+wozOlOr5+qyiUcwCV/Vx6oLDWlXU0exs8RVrYzO3/Wcpp2o3PgC92jqp6ht91zo xQk0rcz2XthIwEB+qY/J1dNJAxT69YzyrN/tnTdk= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiko Carstens , Vasily Gorbik , Sasha Levin Subject: [PATCH 4.14 39/95] s390/smp: __smp_rescan_cpus() - move cpumask away from stack Date: Mon, 15 Mar 2021 14:57:09 +0100 Message-Id: <20210315135741.558259994@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135740.245494252@linuxfoundation.org> References: <20210315135740.245494252@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Greg Kroah-Hartman From: Heiko Carstens [ Upstream commit 62c8dca9e194326802b43c60763f856d782b225c ] Avoid a potentially large stack frame and overflow by making "cpumask_t avail" a static variable. There is no concurrent access due to the existing locking. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- arch/s390/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 40946c8587a5..d43b48d8f67d 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -761,7 +761,7 @@ static int smp_add_core(struct sclp_core_entry *core, cpumask_t *avail, static int __smp_rescan_cpus(struct sclp_core_info *info, bool early) { struct sclp_core_entry *core; - cpumask_t avail; + static cpumask_t avail; bool configured; u16 core_id; int nr, i;