Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094Ab3FZOcc (ORCPT ); Wed, 26 Jun 2013 10:32:32 -0400 Received: from mail-oa0-f48.google.com ([209.85.219.48]:59173 "EHLO mail-oa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729Ab3FZOca (ORCPT ); Wed, 26 Jun 2013 10:32:30 -0400 MIME-Version: 1.0 In-Reply-To: <20130626142852.GA2326@jshin-Toonie> References: <51C87ADC.4070409@canonical.com> <20130625161935.GA10208@jshin-Toonie> <20130626142852.GA2326@jshin-Toonie> Date: Wed, 26 Jun 2013 20:02:29 +0530 Message-ID: Subject: Re: od_set_powersave_bias: NULL pointer dereference From: Viresh Kumar To: Jacob Shin Cc: Tim Gardner , "Rafael J. Wysocki" , LKML , cpufreq@vger.kernel.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 899 Lines: 24 On 26 June 2013 19:58, Jacob Shin wrote: > On Wed, Jun 26, 2013 at 12:18:27PM +0530, Viresh Kumar wrote: >> I am not sure if this is enough. What if we had ondemand as the >> governor initially, then we changed it to something else. Now also >> cur_policy contains a address and isn't zero. > > Right, so we check below .. > >> >> > cpumask_or(&done, &done, policy->cpus); >> > + >> > + if (policy->governor != &cpufreq_gov_ondemand) >> > + continue; > > This should catch that case no ? Policy might be freed and reallocated by then. And so doing policy->governor is dangerous. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/