Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2654217pxa; Mon, 17 Aug 2020 15:37:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysY9B39chmg0MubwTWdXNvueEhE2Ifiv2P+e3QX8038XsfWN5wpbqSWXPanJT61d5Ruif2 X-Received: by 2002:a05:6402:3199:: with SMTP id di25mr17489186edb.315.1597703840850; Mon, 17 Aug 2020 15:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703840; cv=none; d=google.com; s=arc-20160816; b=FuneMSUIUtqDTvGOWRtW0tlgrWY3oTi9Ver86iNARs7hSVScio4+Wso4NlFVUXrl2z k5ttXSU4tStK7/lI/hzRGyuiTpvDKVNWPjNJvA+vNyhJyYVhYHKrgaBYE0pu57nxGJ6K SqB0jHe9iLRsbR5b69SVXacwAmQQRwyxg+MstyNwIZf6T4ZDH57k2/zv9MkVY+mJ8Q4u qkdojk4VGHjq6c8brBuAm7pBBsFA5wjF+EjJ6nz0mUfF8T3JLYeDSuU4Q7iuCn3oDcOZ kjANhlpW3n5O7tyvOS1u3aCkzXQL96YltYw7WxkLr1Ax8wF9Wjq7o9aBSkNhdLROYigT vY3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DgiViq+RdAf1ukuvCs2wgM6PSxkw399fRHBvFzdbV3w=; b=XBijc+UMJ+r6zseCgTVpZ/AydIfK7O2BVlpLA/oy/vd7Av8J9jTcUDk4ubKcToGmJ0 QEwlih8o+M2Bu7Qxhna7B0lA6af2x6lROeav9H3lc16XU0hOsd5/WCPqVk1lSherGZlL ZdYxG7LvVl5PD/58ELovXM4cygNB7iL0U1bdOujpW2opguPus+I/GL3lS+lYMyMwLhzh bZgxkozIZ5OqN3iwdBeZjR8THWj8+sMRRwcGAZZg+RBR/2pMCxfVsMDBppG5uhUcPHDp kHOO0xVfSO/qNegJFvsxsYU88NZPd8GpKIZq/bR6CmqIEfouI/bNaAk3ViYYzIbjzX+q /Mrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XvV9xWrA; 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 r1si11414110eds.230.2020.08.17.15.36.57; Mon, 17 Aug 2020 15:37:20 -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=XvV9xWrA; 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 S2387542AbgHQRha (ORCPT + 99 others); Mon, 17 Aug 2020 13:37:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:60318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729893AbgHQQRY (ORCPT ); Mon, 17 Aug 2020 12:17:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D11DA207FF; Mon, 17 Aug 2020 16:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597681043; bh=HbHefs1iBPgzef623Gxpm21VIKkRHpLV0at4bO95Kgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XvV9xWrAhRk+yxgy0dOId7IwEnRcbEw4qyLSaVtClYEbcUdwgfQELvH+zP71jqUvJ t64Kv3SA2iYCRmE8/jl0KEA4BmuhLTKgPzryiHyoTUMfWnqpMpa4EsP7hLOQKrOY6u 2DpDYW2k6lGkuv4GFriTU3Yuwxawyb8Ld6v2PEXM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ivan Kokshaysky , Andrew Lunn , Viresh Kumar Subject: [PATCH 4.19 158/168] cpufreq: dt: fix oops on armada37xx Date: Mon, 17 Aug 2020 17:18:09 +0200 Message-Id: <20200817143741.564803945@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ivan Kokshaysky commit 10470dec3decaf5ed3c596f85debd7c42777ae12 upstream. Commit 0c868627e617e43a295d8 (cpufreq: dt: Allow platform specific intermediate callbacks) added two function pointers to the struct cpufreq_dt_platform_data. However, armada37xx_cpufreq_driver_init() has this struct (pdata) located on the stack and uses only "suspend" and "resume" fields. So these newly added "get_intermediate" and "target_intermediate" pointers are uninitialized and contain arbitrary non-null values, causing all kinds of trouble. For instance, here is an oops on espressobin after an attempt to change the cpefreq governor: [ 29.174554] Unable to handle kernel execute from non-executable memory at virtual address ffff00003f87bdc0 ... [ 29.269373] pc : 0xffff00003f87bdc0 [ 29.272957] lr : __cpufreq_driver_target+0x138/0x580 ... Fixed by zeroing out pdata before use. Cc: # v5.7+ Signed-off-by: Ivan Kokshaysky Reviewed-by: Andrew Lunn Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/cpufreq/armada-37xx-cpufreq.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/cpufreq/armada-37xx-cpufreq.c +++ b/drivers/cpufreq/armada-37xx-cpufreq.c @@ -458,6 +458,7 @@ static int __init armada37xx_cpufreq_dri /* Now that everything is setup, enable the DVFS at hardware level */ armada37xx_cpufreq_enable_dvfs(nb_pm_base); + memset(&pdata, 0, sizeof(pdata)); pdata.suspend = armada37xx_cpufreq_suspend; pdata.resume = armada37xx_cpufreq_resume;