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] [day] [month] [year] [list]
Message-ID: <1464869307.31709.1.camel@ellerman.id.au>
Date:	Thu, 02 Jun 2016 22:08:27 +1000
From:	Michael Ellerman <mpe@...erman.id.au>
To:	Viresh Kumar <viresh.kumar@...aro.org>
Cc:	Rafael Wysocki <rjw@...ysocki.net>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	linaro-kernel@...ts.linaro.org, linuxppc-dev@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH 3/8] cpufreq: powerenv: Fix memory leak

On Thu, 2016-06-02 at 17:13 +0530, Viresh Kumar wrote:
> On 02-06-16, 21:37, Michael Ellerman wrote:
> > On Thu, 2016-06-02 at 16:52 +0530, Viresh Kumar wrote:
> > > On 02-06-16, 21:08, Michael Ellerman wrote:
> > > > On Wed, 2016-06-01 at 16:04 +0530, Viresh Kumar wrote:
> > > > 
> > > > > The policy is copied (unnecessarily) and is never freed. Fix it by just
> > > > > getting a reference to the existing policy structure and putting it
> > > > > back.
> > > > > 
> > > > > Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> > > > 
> > > > When was it broken, always?
> > > > 
> > > > Cc: stable ?
> > > 
> > > Its a small memory leak and its not that we will fail on something. So
> > > didn't bother to add those details, but in case they are required:
> > > 
> > > Cc: <stable@...r.kernel.org> # 4.3+
> > > Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy->cur on unthrottling")
> > 
> > OK. I can't actually see where the copy is?
> > 
> > But if we are leaking even a small amount of memory in a loop like that, in a
> > function that's run semi-regularly, then it's going to add up eventually.
> 
> Urg, it wasn't a memory leak actually. I misread.
> 
> I somehow thought that cpufreq_get_policy() is also allocating memory
> for the policy, but it just memcpy's it into the callers buffer. So,
> that's not a problem really.
> 
> This patch should be just dropped. Sorry for the noise.

OK, no worries.

cheers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ