Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1456650ybt; Sat, 20 Jun 2020 10:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdxsbFBZrx6pJeSqpOYud4px3CfrheRzixcP2LbUug7vIvsk+ChMIqzm2ArrPlaqbkwaEQ X-Received: by 2002:aa7:d4c5:: with SMTP id t5mr8838590edr.357.1592675832578; Sat, 20 Jun 2020 10:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592675832; cv=none; d=google.com; s=arc-20160816; b=NboVjDianNNcp6Lr8yoNcGc2UlWRJhG4fc63gJcyHBc+CTOmfTqsrQDTVCDPP1FJJP qhnp88s++bV60hOEUuhGvGa0V7h+ilMMeDLUswCDRKHZXxl7Q52vKcyP4bxJyl5g9uzi rad5efSXMinAxavUHt90ue0bg8Vkre71uuAv/DrDlODRYcuL5MYnN/C07w9y77ShheEE TBiAYtSqdUdqiQnOOCk8gXMXq+BUCqyxMVuefGwB6tHBnF/OXYwUKQzA72a+NGQ6qa6f U4qiONCKj6Vi/thkMtqJcEALxiwt/47R+aB77kk0w7Lk4O4j+JQPMQDoV+0YO1oUkuRz w8cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=qSapd5HkoLRQCo4dRQjaPZEqcwjk6/Lb9aDMzmmJhfw=; b=fMLE5gU1B7dCivns3AQchhwAgMCdNk/W9e2pmRbD4sjS0QWxD7kn8Zs/FgWrsjOKNJ D8qmCsTW2wrd86y04eyT/HqbXw7Y9hrXDAaoRpUp9XIm5hSn4KuaYirzHaOgpLevCW+S pccvHO3PnoYgHuyc1l0GdUYMNckxqX33rMpi6LSjNtOu2hNR4iup0vksmVB3YmDKXAGX SxmvDuQe6cDtPNYKLJuqJJ2kmwGOD/5kHvtVGaU9hcilT1Y2BUzv1d2BR3Qt4lsbE9Iw 49xD0chbmWFEWS/tJyRHZAnqz/iPcTkUe2gWAiyj5V7gNDnktd4K5kWHt2KI5U5rxqFC wyuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si6530609eds.50.2020.06.20.10.56.49; Sat, 20 Jun 2020 10:57:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbgFTRyr (ORCPT + 99 others); Sat, 20 Jun 2020 13:54:47 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50370 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728191AbgFTRyr (ORCPT ); Sat, 20 Jun 2020 13:54:47 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1jmhhO-001Q08-4n; Sat, 20 Jun 2020 19:54:38 +0200 Date: Sat, 20 Jun 2020 19:54:38 +0200 From: Andrew Lunn To: Ivan Kokshaysky Cc: Gregory Clement , Jason Cooper , Sebastian Hesselbarth , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: dt: fix oops on armada37xx Message-ID: <20200620175438.GS304147@lunn.ch> References: <20200620164449.GA19776@mail.rc.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200620164449.GA19776@mail.rc.ru> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 20, 2020 at 05:44:49PM +0100, Ivan Kokshaysky wrote: > 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. > > Signed-off-by: Ivan Kokshaysky Hi Ivan A Fixes: tag would be good. Reviewed-by: Andrew Lunn Andrew