Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp189867pxx; Wed, 28 Oct 2020 02:11:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy06eBPfNIhMqosgzuisVTS4vKrNCNfRgWLqC6G4H1nZ6LVjYTPP6WUD0itwG7WhK6ijsc X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr6472526eja.210.1603876313925; Wed, 28 Oct 2020 02:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603876313; cv=none; d=google.com; s=arc-20160816; b=NOdQmWFCDQqnHAVzjepDJODgr5+sVxTw/0sgKMTlyeWFr6XbA4qJRX7jAMQnFml25Y NaBlPHtUA4lB/i/Z4msn9z6WHdJRsgrTHNQF2zG2lfzeMVWly1Z/Pb25HCPsm67G0ZNi F1aD3FkgXbyKNGQ8cGD+Lngop/eDk6mFWMSqs7vSL8LBb4/yvAr+64Mh/Fh/XJFBmQLv GWQkwiVQtMFct0SWhNxpfGPrPdpwcw8XpAeEoIbD/aSO5KNoC9DuGUgEucutJJMpqaZK W7XwActJwWv4fxCVvlU3ZflvXVbCxbnE8HbQwA1F2nTCnTH7EL+KqwtLO8mnEzN3ZaHA /Cdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y9yjvoduZRaIYnTha+w/op1lBtiJpZySXlutJYuTFUQ=; b=qVZfvz+9zCo8cw+FAhpBXcmzUjrd0r2Tiz6RR0mnXLDSFplVMOnsfOAwDmHbHyzsdA q3ySBbo84Xn//q+zbeQZs7ct4ytBRnMlpK1xqKQhfw5RhRotHpyWIhKRPHbAtANwl0qb /IDE3SiaZZSIFxsaT3s84RZWudnIDqkOjzNd0p0o8edwpF/4c/CFwsiHv0fTy1ECI8QW Ist0Yi+gLimQy8Q3Y9qiPFW4gl86kSYtfuBaAXbX6Kqm4z+6YG7Gm+pJLrRFqGbCrVO8 JmzmYsdcGxiXJyi3oS7NQSwR42iOShKz9i8/s934nXrWF3jtNU7ipEW2e9MsFSPz4myB Wg3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p0maz7Dc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si2654785ede.591.2020.10.28.02.11.32; Wed, 28 Oct 2020 02:11:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p0maz7Dc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757282AbgJ0ORZ (ORCPT + 99 others); Tue, 27 Oct 2020 10:17:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:35374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756516AbgJ0ONx (ORCPT ); Tue, 27 Oct 2020 10:13:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5DAEA206F7; Tue, 27 Oct 2020 14:13:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808032; bh=MLuDDTaUB4uTmwZ4dpT5VYniVaviqDvFtxNSNE2cCGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p0maz7DcGIRTU4o+ezj98CWJHQikZA5Ponbmdo7I5s8RhUfLtNa+PjgcglhcwDuIH loh57/2Ffs90s2RGgTb7CLKsS5do1HfynT8s98TXSUdaf/5UAYJANbIlA69qTMJSs3 rIu9e0kAgpeP476VWPJur6qM3019G4POzFBkmDNM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srikar Dronamraju , Daniel Axtens , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 104/191] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier Date: Tue, 27 Oct 2020 14:49:19 +0100 Message-Id: <20201027134914.699029638@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srikar Dronamraju [ Upstream commit a2d0230b91f7e23ceb5d8fb6a9799f30517ec33a ] The patch avoids allocating cpufreq_policy on stack hence fixing frame size overflow in 'powernv_cpufreq_reboot_notifier': drivers/cpufreq/powernv-cpufreq.c: In function powernv_cpufreq_reboot_notifier: drivers/cpufreq/powernv-cpufreq.c:906:1: error: the frame size of 2064 bytes is larger than 2048 bytes Fixes: cf30af76 ("cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec") Signed-off-by: Srikar Dronamraju Reviewed-by: Daniel Axtens Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200922080254.41497-1-srikar@linux.vnet.ibm.com Signed-off-by: Sasha Levin --- drivers/cpufreq/powernv-cpufreq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index dc81fc2bf8015..56c3d86e5b9de 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -846,12 +846,15 @@ static int powernv_cpufreq_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) { int cpu; - struct cpufreq_policy cpu_policy; + struct cpufreq_policy *cpu_policy; rebooting = true; for_each_online_cpu(cpu) { - cpufreq_get_policy(&cpu_policy, cpu); - powernv_cpufreq_target_index(&cpu_policy, get_nominal_index()); + cpu_policy = cpufreq_cpu_get(cpu); + if (!cpu_policy) + continue; + powernv_cpufreq_target_index(cpu_policy, get_nominal_index()); + cpufreq_cpu_put(cpu_policy); } return NOTIFY_DONE; -- 2.25.1