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: <4CA567DB.4000208@kernel.org>
Date:	Fri, 01 Oct 2010 07:47:23 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	Dave Jones <davej@...hat.com>, dave@....org,
	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

  Hi Dave,

On 30.9.2010 23.06, Dave Jones wrote:
> On Thu, Sep 30, 2010 at 10:59:51PM +0300, Pekka Enberg wrote:
>   >  >  +++ 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.
>
> I think Dave's patch is correct.  There's a kfree(output.pointer) at line 359.
> If we fall all the way through without hitting any of the return -ENODEVs,
> we end up doing a 2nd kfree in the out_free:

There's a second call to acpi_evaluate_object() which takes "output" as 
its argument and allocates more memory.
--
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