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]
Date:	Thu, 30 Sep 2010 22:59:51 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	dave@....org
Cc:	davej@...hat.com, cpufreq@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>,
	x86 maintainers <x86@...nel.org>
Subject: Re: [RESEND PATCH] cpufreq: unnecesary double free in pcc_cpufreq_do_osc

On Thu, Sep 30, 2010 at 10:43 PM, Davidlohr Bueso <dave@....org> wrote:
> x86, cpufreq: avoid an unnecessary double free when finished in pcc_cpufreq_do_osc()
>
> There is no need to fall through the out_free label thus saving a kfree call.
>
> Signed-off-by: Davidlohr Bueso <dave@....org>
> ---
>  arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
> index 994230d..db7dc35 100644
> --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
> +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
> @@ -379,6 +379,8 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle)
>        if (!(supported & 0x1))
>                return -ENODEV;
>
> +       return ret;
> +
>  out_free:
>        kfree(output.pointer);
>        return ret;

Where is the double free here? I can't see it. I do see memory leaks
happening in error handling paths of pcc_cpufreq_do_osc() which makes
me think we need something like the attached patch.

Download attachment "0001-x86-cpufreq-Fix-pcc_cpufreq_do_osc-memory-leaks.patch" of type "application/octet-stream" (1397 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ