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, 17 Aug 2023 10:32:19 -0400
From:   Jeff Moyer <jmoyer@...hat.com>
To:     Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
Cc:     <dan.j.williams@...el.com>, <vishal.l.verma@...el.com>,
        <dave.jiang@...el.com>, <ira.weiny@...el.com>,
        <nvdimm@...ts.linux.dev>, <linux-kernel@...r.kernel.org>,
        <yusongping@...wei.com>, <artem.kuzin@...wei.com>
Subject: Re: [PATCH] drivers: nvdimm: fix memleak

Konstantin Meskhidze <konstantin.meskhidze@...wei.com> writes:

> Memory pointed by 'nd_pmu->pmu.attr_groups' is allocated in function
> 'register_nvdimm_pmu' and is lost after 'kfree(nd_pmu)' call in function
> 'unregister_nvdimm_pmu'.
>
> Co-developed-by: Ivanov Mikhail <ivanov.mikhail1@...wei-partners.com>
> Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@...wei.com>
> ---
>  drivers/nvdimm/nd_perf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/nvdimm/nd_perf.c b/drivers/nvdimm/nd_perf.c
> index 433bbb68a..14881c4e0 100644
> --- a/drivers/nvdimm/nd_perf.c
> +++ b/drivers/nvdimm/nd_perf.c
> @@ -323,7 +323,8 @@ EXPORT_SYMBOL_GPL(register_nvdimm_pmu);
>  void unregister_nvdimm_pmu(struct nvdimm_pmu *nd_pmu)
>  {
>  	perf_pmu_unregister(&nd_pmu->pmu);
>  	nvdimm_pmu_free_hotplug_memory(nd_pmu);
> +	kfree(nd_pmu->pmu.attr_groups);
>  	kfree(nd_pmu);
>  }
>  EXPORT_SYMBOL_GPL(unregister_nvdimm_pmu);

Reviewed-by: Jeff Moyer <jmoyer@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ