Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2652231pxa; Mon, 17 Aug 2020 15:34:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJlQNh9KWKmjeyC47aT1bjrjiBGrciNdc5/vvI9UIxmCeqeKNbpYtMnA9JIgPTRJI7NKNz X-Received: by 2002:aa7:cb45:: with SMTP id w5mr16896299edt.77.1597703647488; Mon, 17 Aug 2020 15:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703647; cv=none; d=google.com; s=arc-20160816; b=HfBNoynhdihmffl+4JW939mLS/2l/6ohA3hTVzpCM4a0xeXy4KZvLUcJRzBNbX82Hn xMQJKADeR1QgRsl6dwnMdiK8u0Q5oBPJV4s53kEZ6+otrOkzVrt85Hd6FvcAqPpv/5fH 0KaWCofyR72mL8ASnng+6wht16P6uT+4pQasHZk6o1f17+ue4/l0wGfzYm4cJiPnCYqB vfuri/jHakaMdxveNnjMM3oORml+lE42WjwAB4u5tfhogYIxLyE2jFB6uV6isosyauRD NEd1mZsHTCsTCzCIlpMv2khMki3eUsFmIZnbd4WtlheejWH4TfowKZYXpNddQVSmzJWf +iNw== 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=1toZSjGRsJe8o2mRmVhS9rPMPAna/kWqV9nfjGCItz0=; b=MlQvdfFhCNWOX+7U+64VUi6MjOG94NDmI4YYg5vaaIBfAclCbMdjd8fG+flpeYzdzG 8Od5WXVsFbDAg7dx8qKhn+f1M1c7YydtIIeH2fTFvYSn/373zxyck3UdhEx8/o4qkbhU ii91WATYJ6b9uds5Jznx7p/DBg9zulMKLlBFbV7/3szsAI6BUYkHuXSp5Xg13MXbKrzs HS4QdjSoFuE9UUlREe4PG/8Rh7J00jCt8s53zV+/FhW3Rdaer9u3KEjnfyHhcBIodzKE cBKoAV/eyLnx2C48pToF93dXhVHCraEnfD8ZnnlmsEoodKSHkONUHTlP+Iajln97+gwq X4RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NHZx5EWf; 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 f27si12829700ejt.13.2020.08.17.15.33.27; Mon, 17 Aug 2020 15:34:07 -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=NHZx5EWf; 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 S2389161AbgHQRGg (ORCPT + 99 others); Mon, 17 Aug 2020 13:06:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:60452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388512AbgHQQJd (ORCPT ); Mon, 17 Aug 2020 12:09:33 -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 131B020760; Mon, 17 Aug 2020 16:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680572; bh=tUg0ufDbgldg0Nz5MOqtxis8bznVshMzTik0MI4PymY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NHZx5EWfJzw0z7c8+5Ra1R1vAI+rioGf5156XAuJdohobDC/9C869Z1B3Uv1qp1s1 rUz6GmevB6phxUfISxAG161YY+CT8sdUMyl+FWKoqPOFn9mv778Mc6B466EpMlmb2T P0bksBwcdL0OynZNGQCQUO2vNSZR4C4+ZgywDs2s= 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 5.4 241/270] cpufreq: dt: fix oops on armada37xx Date: Mon, 17 Aug 2020 17:17:22 +0200 Message-Id: <20200817143807.811386707@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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 @@ -456,6 +456,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;