lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50E6709D.5080709@linux.vnet.ibm.com>
Date:	Fri, 04 Jan 2013 11:33:09 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Viresh Kumar <viresh.kumar@...aro.org>
CC:	rjw@...k.pl, rafael.j.wysocki@...el.com,
	linaro-dev@...ts.linaro.org, nicolas.pitre@...aro.org,
	amit.kucheria@...aro.org, mathieu.poirier@...aro.org,
	linux-kernel@...r.kernel.org, cpufreq@...r.kernel.org,
	pdsw-power-team@....com, linux-pm@...r.kernel.org
Subject: Re: [PATCH 3/3] cpufreq: Don't use cpu removed during cpufreq_driver_unregister

On 01/04/2013 10:49 AM, Viresh Kumar wrote:
> On 3 January 2013 19:55, Srivatsa S. Bhat
> <srivatsa.bhat@...ux.vnet.ibm.com> wrote:
>> I took a quick look at the problem you described above, and the cpufreq code..
>> If we cannot avoid calling cpufreq_add_dev() from cpufreq_remove_dev(), then I can't
>> think of anything better than what your patch does.
> 
> Good :)
> 
>> BTW, off-topic, while going through that path, I think I found a memory leak
>> in __cpufreq_remove_dev():
>>
>>         if (unlikely(cpumask_weight(data->cpus) > 1)) {
>>                 for_each_cpu(j, data->cpus) {
>>                         if (j == cpu)
>>                                 continue;
>>                         per_cpu(cpufreq_cpu_data, j) = NULL;
>>                 }
>>         }
>>
>> We are assigning NULL without freeing that memory.
> 
> Not really. All cpus in affected_cpus (data->cpus), share the same
> policy structure.
> We have already taken backup of cpufreq_cpu_data for the first cpu in "data" and
> are freeing it here:
> 
> 	kfree(data);
> 

Ah, ok, got it. Thanks!

Regards,
Srivatsa S. Bhat

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ